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

Side by Side Diff: chrome/browser/resources/settings/reset_page/reset_profile_dialog.js

Issue 2411383003: md-settings: add reset request origin to reset feedback proto. (Closed)
Patch Set: Test cleanup Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 7 *
8 * 'settings-reset-profile-dialog' is the dialog shown for clearing profile 8 * 'settings-reset-profile-dialog' is the dialog shown for clearing profile
9 * settings. A triggered variant of this dialog can be shown under certain 9 * settings. A triggered variant of this dialog can be shown under certain
10 * circumstances. See triggered_profile_resetter.h for when the triggered 10 * circumstances. See triggered_profile_resetter.h for when the triggered
(...skipping 14 matching lines...) Expand all
25 value: false, 25 value: false,
26 }, 26 },
27 27
28 /** @private */ 28 /** @private */
29 triggeredResetToolName_: { 29 triggeredResetToolName_: {
30 type: String, 30 type: String,
31 value: '', 31 value: '',
32 }, 32 },
33 33
34 /** @private */ 34 /** @private */
35 resetRequestOrigin_: {
hcarmona 2016/10/13 20:30:19 Please change to: resetRequestOrigin: String, Ha
alito 2016/10/13 21:27:28 Done.
36 type: String,
37 value: '',
38 },
39
40 /** @private */
35 clearingInProgress_: { 41 clearingInProgress_: {
36 type: Boolean, 42 type: Boolean,
37 value: false, 43 value: false,
38 }, 44 },
39 }, 45 },
40 46
41 /** @private {!settings.ResetBrowserProxy} */ 47 /** @private {!settings.ResetBrowserProxy} */
42 browserProxy_: null, 48 browserProxy_: null,
43 49
44 /** 50 /**
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 this.$.dialog.showModal(); 85 this.$.dialog.showModal();
80 this.browserProxy_.onShowResetProfileDialog(); 86 this.browserProxy_.onShowResetProfileDialog();
81 }, 87 },
82 88
83 /** @override */ 89 /** @override */
84 attached: function() { 90 attached: function() {
85 this.isTriggered_ = 91 this.isTriggered_ =
86 settings.getCurrentRoute() == settings.Route.TRIGGERED_RESET_DIALOG; 92 settings.getCurrentRoute() == settings.Route.TRIGGERED_RESET_DIALOG;
87 if (this.isTriggered_) { 93 if (this.isTriggered_) {
88 this.browserProxy_.getTriggeredResetToolName().then(function(name) { 94 this.browserProxy_.getTriggeredResetToolName().then(function(name) {
95 this.resetRequestOrigin_ = 'triggeredreset';
89 this.triggeredResetToolName_ = name; 96 this.triggeredResetToolName_ = name;
90 this.showDialog_(); 97 this.showDialog_();
91 }.bind(this)); 98 }.bind(this));
92 } else { 99 } else {
100 var origin = window.location.hash.slice(1).toLowerCase() == 'cct' ?
hcarmona 2016/10/13 20:30:19 Please add a comment explaining why 'cct' is impor
alito 2016/10/13 21:27:28 Done.
101 'cct' : settings.getQueryParameters().get('origin');
102 this.resetRequestOrigin_ = origin || '';
93 this.showDialog_(); 103 this.showDialog_();
94 } 104 }
95 }, 105 },
96 106
97 /** @private */ 107 /** @private */
98 onCancelTap_: function() { 108 onCancelTap_: function() {
99 this.$.dialog.cancel(); 109 this.$.dialog.cancel();
100 }, 110 },
101 111
102 /** @private */ 112 /** @private */
103 onResetTap_: function() { 113 onResetTap_: function() {
104 this.clearingInProgress_ = true; 114 this.clearingInProgress_ = true;
105 this.browserProxy_.performResetProfileSettings( 115 this.browserProxy_.performResetProfileSettings(
106 this.$.sendSettings.checked).then(function() { 116 this.$.sendSettings.checked, this.resetRequestOrigin_).then(function() {
107 this.clearingInProgress_ = false; 117 this.clearingInProgress_ = false;
108 if (this.$.dialog.open) 118 if (this.$.dialog.open)
109 this.$.dialog.close(); 119 this.$.dialog.close();
110 this.fire('reset-done'); 120 this.fire('reset-done');
111 }.bind(this)); 121 }.bind(this));
112 }, 122 },
113 123
114 /** 124 /**
115 * Displays the settings that will be reported in a new tab. 125 * Displays the settings that will be reported in a new tab.
116 * @private 126 * @private
117 */ 127 */
118 onShowReportedSettingsTap_: function() { 128 onShowReportedSettingsTap_: function() {
119 this.browserProxy_.showReportedSettings(); 129 this.browserProxy_.showReportedSettings();
120 }, 130 },
121 }); 131 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698