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

Unified Diff: chrome/browser/resources/options/reset_profile_settings_overlay.js

Issue 2236663002: Add origin of settings reset request to feedback reports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move cct hash definition to options::ResetProfileSettingsHandler Created 4 years, 3 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/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 74296225bb8560ec6e6fbe224e2234f6832ba6d2..55091cf4efbf38a0b3ba8fffd77ee0634768d11f 100644
--- a/chrome/browser/resources/options/reset_profile_settings_overlay.js
+++ b/chrome/browser/resources/options/reset_profile_settings_overlay.js
@@ -44,22 +44,23 @@ cr.define('options', function() {
initializePage: function() {
Page.prototype.initializePage.call(this);
- // Set the onclick handlers only once when initializing the regular reset
- // profile settings overlay.
- if (!this.isTriggered_) {
+ if (!ResetProfileSettingsOverlay.listenersAdded_) {
$('reset-profile-settings-dismiss').onclick = function(e) {
ResetProfileSettingsOverlay.dismiss();
};
$('reset-profile-settings-commit').onclick = function(e) {
ResetProfileSettingsOverlay.setResettingState(true);
chrome.send('performResetProfileSettings',
- [$('send-settings').checked]);
+ [$('send-settings').checked,
+ ResetProfileSettingsOverlay.resetRequestOrigin_]);
};
$('expand-feedback').onclick = function(e) {
var feedbackTemplate = $('feedback-template');
feedbackTemplate.hidden = !feedbackTemplate.hidden;
e.preventDefault();
};
+
+ ResetProfileSettingsOverlay.listenersAdded_ = true;
}
},
@@ -79,6 +80,23 @@ cr.define('options', function() {
'triggeredResetProfileSettingsExplanation' :
'resetProfileSettingsExplanation');
+ // Set ResetProfileSettingsOverlay.resetRequestOrigin_ to indicate where
+ // the reset request came from.
+ if (this.isTriggered_) {
+ ResetProfileSettingsOverlay.resetRequestOrigin_ = 'triggeredreset';
+ } else {
+ // For the non-triggered reset overlay, a '#userclick' hash indicates
+ // that the reset request came from the user clicking on the reset
+ // settings button and is set by the browser_options page. A '#cct' hash
+ // indicates that the reset request came from the CCT by launching
+ // Chrome with the startup URL
+ // chrome://settings/resetProfileSettings#cct.
+ var hash = this.hash.slice(1).toLowerCase();
+ ResetProfileSettingsOverlay.resetRequestOrigin_ =
+ (hash === 'cct' || hash === 'userclick') ? hash : '';
+ this.setHash('');
+ }
+
chrome.send('onShowResetProfileDialog');
},
@@ -88,6 +106,12 @@ cr.define('options', function() {
},
};
+ /** @private {boolean} */
+ ResetProfileSettingsOverlay.listenersAdded_ = false;
+
+ /** @private {string} */
+ ResetProfileSettingsOverlay.resetRequestOrigin_ = '';
+
/**
* Enables/disables UI elements after/while Chrome is performing a reset.
* @param {boolean} state If true, UI elements are disabled.
« no previous file with comments | « chrome/browser/resources/options/browser_options.js ('k') | chrome/browser/ui/startup/startup_browser_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698