Skip to content

Commit

Permalink
Enable importing passwords from Firefox, closes brave#9292
Browse files Browse the repository at this point in the history
Auditors: @darkdh
  • Loading branch information
evq committed Jun 20, 2017
1 parent 4688b1c commit baf8125
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 0 additions & 3 deletions app/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ importer.on('update-supported-browsers', (e, detail) => {
}
})

importer.on('add-password-form', (e, detail) => {
})

importer.on('add-history-page', (e, history, visitSource) => {
let sites = []
for (let i = 0; i < history.length; ++i) {
Expand Down
11 changes: 11 additions & 0 deletions app/renderer/components/main/importBrowserDataPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class ImportBrowserDataPanel extends React.Component {
this.onToggleHistory = this.onToggleSetting.bind(this, 'history')
this.onToggleFavorites = this.onToggleSetting.bind(this, 'favorites')
this.onToggleCookies = this.onToggleSetting.bind(this, 'cookies')
this.onTogglePasswords = this.onToggleSetting.bind(this, 'passwords')
this.onImport = this.onImport.bind(this)
this.onChange = this.onChange.bind(this)
}
Expand All @@ -50,6 +51,7 @@ class ImportBrowserDataPanel extends React.Component {
data.favorites = this.props.favorites
data.history = this.props.history
data.type = this.props.type
data.passwords = this.props.passwords

appActions.importBrowserData(Immutable.fromJS(data))
this.onHide()
Expand Down Expand Up @@ -83,11 +85,13 @@ class ImportBrowserDataPanel extends React.Component {
props.isSupportingHistory = currentSelectedBrowser.get('history', false)
props.isSupportingFavorites = currentSelectedBrowser.get('favorites', false)
props.isSupportingCookies = currentSelectedBrowser.get('cookies', false)
props.isSupportingPasswords = currentSelectedBrowser.get('passwords', false)
props.currentIndex = index
props.cookies = importBrowserDataSelected.get('cookies')
props.favorites = importBrowserDataSelected.get('favorites')
props.history = importBrowserDataSelected.get('history')
props.type = importBrowserDataSelected.get('type')
props.passwords = importBrowserDataSelected.get('passwords')

// used in other functions
props.selectedIndex = importBrowserDataSelected.get('index')
Expand Down Expand Up @@ -132,6 +136,13 @@ class ImportBrowserDataPanel extends React.Component {
onClick={this.onToggleCookies}
disabled={!this.props.isSupportingCookies}
/>
<SwitchControl
rightl10nId='savedPasswords'
checkedOn={this.props.passwords}
onClick={this.onTogglePasswords}
disabled={!this.props.isSupportingPasswords}
/>

</CommonFormSection>
<CommonFormSection>
<div data-l10n-id='importDataCloseBrowserWarning' />
Expand Down

0 comments on commit baf8125

Please sign in to comment.