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

Unified Diff: chrome/browser/resources/settings/reset_page/reset_page.js

Issue 1419053008: MD Settings: Construct reset profile dialog only when needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@reset_ui2
Patch Set: rebase Created 5 years, 1 month 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/reset_page/reset_page.js
diff --git a/chrome/browser/resources/settings/reset_page/reset_page.js b/chrome/browser/resources/settings/reset_page/reset_page.js
index 5e57cb0f51f8f74fae9f2cd45480b996cc0abe47..c0a577726a5caac3a1bb48b3b2f7ba1ffbc2ad68 100644
--- a/chrome/browser/resources/settings/reset_page/reset_page.js
+++ b/chrome/browser/resources/settings/reset_page/reset_page.js
@@ -21,56 +21,15 @@
Polymer({
is: 'settings-reset-page',
- properties: {
- feedbackInfo_: String,
- },
-
- attached: function() {
- cr.define('SettingsResetPage', function() {
- return {
- doneResetting: function() {
- this.$.resetSpinner.active = false;
- this.$.resetDialog.close();
- }.bind(this),
-
- setFeedbackInfo: function(data) {
- this.set('feedbackInfo_', data.feedbackInfo);
- this.async(function() {
- this.$.resetDialog.center();
- });
- }.bind(this),
- };
- }.bind(this));
- },
/** @private */
onShowDialog_: function() {
- this.$.resetDialog.open();
- chrome.send('onShowResetProfileDialog');
- },
-
- /** @private */
- onCancelTap_: function() {
- this.$.resetDialog.close();
- chrome.send('onHideResetProfileDialog');
- },
+ var dialog = document.createElement('settings-reset-profile-dialog');
+ this.shadowRoot.appendChild(dialog);
+ dialog.open();
- /** @private */
- onResetTap_: function() {
- this.$.resetSpinner.active = true;
- chrome.send('performResetProfileSettings', [this.$.sendSettings.checked]);
+ dialog.addEventListener('iron-overlay-closed', function(event) {
+ dialog.remove();
+ });
},
-
- /** @private */
- onLearnMoreTap_: function() {
- window.open(loadTimeData.getString('resetPageLearnMoreUrl'));
- },
-
- /** @private */
- onSendSettingsChange_: function() {
- // TODO(dpapad): Update how settings info is surfaced when final mocks
- // exist.
- this.$.settings.hidden = !this.$.sendSettings.checked;
- this.$.resetDialog.center();
- }
});

Powered by Google App Engine
This is Rietveld 408576698