Chromium Code Reviews| Index: chrome/browser/resources/options/reset_profile_settings_overlay.js |
| diff --git a/chrome/browser/resources/options/reset_profile_settings_overlay.js b/chrome/browser/resources/options/reset_profile_settings_overlay.js |
| index 7da9e29642459e099cd8debd5830e9bf03aed3f9..2da560f2899ba0d0bd3a4a931024f1cf0e4c9661 100644 |
| --- a/chrome/browser/resources/options/reset_profile_settings_overlay.js |
| +++ b/chrome/browser/resources/options/reset_profile_settings_overlay.js |
| @@ -4,6 +4,7 @@ |
| cr.define('options', function() { |
| var Page = cr.ui.pageManager.Page; |
| + var resetRequestOrigin = ''; |
| var AutomaticSettingsResetBanner = options.AutomaticSettingsResetBanner; |
| @@ -35,7 +36,7 @@ cr.define('options', function() { |
| $('reset-profile-settings-commit').onclick = function(e) { |
| ResetProfileSettingsOverlay.setResettingState(true); |
| chrome.send('performResetProfileSettings', |
| - [$('send-settings').checked]); |
| + [$('send-settings').checked, resetRequestOrigin]); |
| }; |
| $('expand-feedback').onclick = function(e) { |
| var feedbackTemplate = $('feedback-template'); |
| @@ -51,6 +52,22 @@ cr.define('options', function() { |
| * chrome/browser/resources/options/automatic_settings_reset_banner.js. |
| */ |
| didShowPage: function() { |
| + if (this.hash === '#userClick') { |
| + // A '#userClick' hash indicates that the reset request came from the |
| + // user clicking on the reset settings button. This hash is set by the |
| + // browser_options page. |
| + this.setResetRequestOrigin('userClick'); |
| + this.setHash(''); |
| + } else if (this.hash == '#CCT') { |
| + // A '#CCT' hash indicates that the reset request came from the CCT by |
| + // launching Chrome with startup URL |
|
robertshield
2016/08/10 20:35:41
nit: with *the* startup URL
alito
2016/08/10 21:06:33
Done.
|
| + // chrome://settings/resetProfileSettings#CCT. |
| + this.setResetRequestOrigin('CCT'); |
| + this.setHash(''); |
| + } else { |
| + this.setResetRequestOrigin(''); |
| + } |
| + |
| $('reset-profile-settings-title').textContent = |
| loadTimeData.getString('resetProfileSettingsOverlay'); |
| $('reset-profile-settings-explanation').textContent = |
| @@ -63,6 +80,15 @@ cr.define('options', function() { |
| didClosePage: function() { |
| chrome.send('onHideResetProfileDialog'); |
| }, |
| + |
| + /** |
| + * Sets the reset request origin string. To be used also by subclasses, such |
| + * as TriggeredResetProfileSettingsOverlay. |
| + * @param {string} origin Origin of the reset request. |
| + */ |
| + setResetRequestOrigin: function(origin) { |
| + resetRequestOrigin = origin; |
| + } |
| }; |
| /** |