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

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: Adressed Dan's comments Created 4 years, 4 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 7da9e29642459e099cd8debd5830e9bf03aed3f9..97638341c21a80368d2f5fed78abc06f93ff467d 100644
--- a/chrome/browser/resources/options/reset_profile_settings_overlay.js
+++ b/chrome/browser/resources/options/reset_profile_settings_overlay.js
@@ -25,6 +25,9 @@ cr.define('options', function() {
// Inherit ResetProfileSettingsOverlay from Page.
__proto__: Page.prototype,
+ /** @private {string} */
+ resetRequestOrigin_: '',
+
/** @override */
initializePage: function() {
Page.prototype.initializePage.call(this);
@@ -35,7 +38,9 @@ cr.define('options', function() {
$('reset-profile-settings-commit').onclick = function(e) {
ResetProfileSettingsOverlay.setResettingState(true);
chrome.send('performResetProfileSettings',
- [$('send-settings').checked]);
+ [$('send-settings').checked,
+ ResetProfileSettingsOverlay.getInstance()
Dan Beam 2016/08/23 05:48:23 this.resetRequestOrigin_
alito 2016/08/23 18:20:34 Can't use 'this' here. See explanation in the comm
+ .getResetRequestOrigin()]);
};
Dan Beam 2016/08/23 05:48:22 }.bind(this);
alito 2016/08/23 18:20:34 This doesn't work on Windows. On Windows, Triggere
Dan Beam 2016/08/23 22:46:53 they're the same object with a different prototype
alito 2016/08/24 21:17:01 Well, my explanation for why .bind(this) doesn't w
alito 2016/08/24 21:49:22 I've used the debugger and the console. From what
$('expand-feedback').onclick = function(e) {
var feedbackTemplate = $('feedback-template');
@@ -51,6 +56,22 @@ cr.define('options', function() {
* chrome/browser/resources/options/automatic_settings_reset_banner.js.
*/
didShowPage: function() {
Dan Beam 2016/08/23 05:48:22 var hash = this.hash.slice(1).toLowerCase(); this.
alito 2016/08/23 18:20:34 Done.
+ 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 the startup URL
+ // 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 +84,19 @@ 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.
Dan Beam 2016/08/23 05:48:22 can you make this @protected?
alito 2016/08/23 18:20:34 Removed the setter. Now setting resetRequestOrigin
+ */
+ setResetRequestOrigin: function(origin) {
+ this.resetRequestOrigin_ = origin;
Dan Beam 2016/08/23 05:48:22 why not set this directly?
alito 2016/08/23 18:20:34 I assumed you meant that TriggeredResetProfileSett
+ },
+
+ getResetRequestOrigin: function() {
Dan Beam 2016/08/23 05:48:23 remove this getter
alito 2016/08/23 18:20:34 Done.
+ return this.resetRequestOrigin_;
+ },
};
/**

Powered by Google App Engine
This is Rietveld 408576698