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

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

Issue 2717013002: MD Settings: Stop using prefs to populate import data dialog. (Closed)
Patch Set: Nits. 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 6e0f1c2c0004de8d222fe9ec01188f69b0b09fe7..a63b30832a1f07de064042c502f2b0934e2f7b10 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.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);
},
/**
@@ -115,6 +116,7 @@ Polymer({
/** @private */
onBrowserProfileSelectionChange_: function() {
this.selected_ = this.browserProfiles_[this.$.browserSelect.selectedIndex];
+ this.onCheckboxChange_();
},
/** @private */

Powered by Google App Engine
This is Rietveld 408576698