Chromium Code Reviews| Index: chrome/browser/resources/settings/people_page/import_data_dialog.js |
| diff --git a/chrome/browser/resources/settings/people_page/import_data_dialog.js b/chrome/browser/resources/settings/people_page/import_data_dialog.js |
| index 6e0f1c2c0004de8d222fe9ec01188f69b0b09fe7..ed93bd3a2b7e2cb2fb5c7d450bff5c59a09e9260 100644 |
| --- a/chrome/browser/resources/settings/people_page/import_data_dialog.js |
| +++ b/chrome/browser/resources/settings/people_page/import_data_dialog.js |
| @@ -9,7 +9,7 @@ |
| Polymer({ |
| is: 'settings-import-data-dialog', |
| - behaviors: [I18nBehavior, WebUIListenerBehavior, PrefsBehavior], |
| + behaviors: [I18nBehavior, WebUIListenerBehavior], |
| properties: { |
| /** @private {!Array<!settings.BrowserProfile>} */ |
| @@ -41,11 +41,10 @@ Polymer({ |
| type: Object, |
| value: settings.ImportDataStatus, |
| }, |
| - }, |
| - observers: [ |
| - 'prefsChanged_(selected_, prefs.*)', |
| - ], |
| + /** @private */ |
| + showBookmarkSuccess_: Boolean, |
| + }, |
| /** @private {?settings.ImportDataBrowserProxy} */ |
| browserProxy_: null, |
| @@ -69,22 +68,24 @@ Polymer({ |
| /** @param {settings.ImportDataStatus} importStatus */ |
| function(importStatus) { |
| this.importStatus_ = importStatus; |
| + if (this.hasImportStatus_(settings.ImportDataStatus.SUCCEEDED)) { |
| + this.showBookmarkSuccess_ = |
| + this.$.favorites.checked && this.selected_.favorites; |
| + } |
| + |
| if (this.hasImportStatus_(settings.ImportDataStatus.FAILED)) |
| this.closeDialog_(); |
| }.bind(this)); |
| }, |
| /** @private */ |
| - prefsChanged_: function() { |
| + onCheckboxChange_: function() { |
| this.noImportDataTypeSelected_ = |
| - !(this.getPref('import_history').value && this.selected_.history) && |
| - !(this.getPref('import_bookmarks').value && this.selected_.favorites) && |
| - !(this.getPref('import_saved_passwords').value && |
| - this.selected_.passwords) && |
| - !(this.getPref('import_search_engine').value && |
| - this.selected_.search) && |
| - !(this.getPref('import_autofill_form_data').value && |
| - this.selected_.autofillFormData); |
| + !(this.$.history.checked && this.selected_.history) && |
|
Dan Beam
2017/02/27 18:39:24
arguable nit: we should reverse these conditionals
dpapad
2017/02/27 19:55:00
Done.
|
| + !(this.$.favorites.checked && this.selected_.favorites) && |
| + !(this.$.passwords.checked && this.selected_.passwords) && |
| + !(this.$.search.checked && this.selected_.search) && |
| + !(this.$.autofillFormData.checked && this.selected_.autofillFormData); |
| }, |
| /** |
| @@ -115,6 +116,7 @@ Polymer({ |
| /** @private */ |
| onBrowserProfileSelectionChange_: function() { |
| this.selected_ = this.browserProfiles_[this.$.browserSelect.selectedIndex]; |
| + this.onCheckboxChange_(); |
| }, |
| /** @private */ |