Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6995)

Unified Diff: chrome/browser/resources/settings/people_page/import_data_dialog.js

Issue 2727513002: Revert of MD Settings: Stop using prefs to populate import data dialog. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 a63b30832a1f07de064042c502f2b0934e2f7b10..6e0f1c2c0004de8d222fe9ec01188f69b0b09fe7 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],
+ behaviors: [I18nBehavior, WebUIListenerBehavior, PrefsBehavior],
properties: {
/** @private {!Array<!settings.BrowserProfile>} */
@@ -41,10 +41,11 @@
type: Object,
value: settings.ImportDataStatus,
},
+ },
- /** @private */
- showBookmarkSuccess_: Boolean,
- },
+ observers: [
+ 'prefsChanged_(selected_, prefs.*)',
+ ],
/** @private {?settings.ImportDataBrowserProxy} */
browserProxy_: null,
@@ -68,24 +69,22 @@
/** @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 */
- onCheckboxChange_: function() {
+ prefsChanged_: function() {
this.noImportDataTypeSelected_ =
- !(this.selected_.history && this.$.history.checked) &&
- !(this.selected_.favorites && this.$.favorites.checked) &&
- !(this.selected_.passwords && this.$.passwords.checked) &&
- !(this.selected_.search && this.$.search.checked) &&
- !(this.selected_.autofillFormData && this.$.autofillFormData.checked);
+ !(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);
},
/**
@@ -116,7 +115,6 @@
/** @private */
onBrowserProfileSelectionChange_: function() {
this.selected_ = this.browserProfiles_[this.$.browserSelect.selectedIndex];
- this.onCheckboxChange_();
},
/** @private */

Powered by Google App Engine
This is Rietveld 408576698