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

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

Issue 1455063003: Fix JS whoopsies from https://crrev.com/e2f61d09c3f (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « chrome/browser/resources/options/automatic_settings_reset_banner.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/automatic_settings_reset_banner.js
diff --git a/chrome/browser/resources/options/automatic_settings_reset_banner.js b/chrome/browser/resources/options/automatic_settings_reset_banner.js
index bdd909059d2052a734b3c651dfb71b185bbc4813..8e5f7aa19fa5672d33bda816b5df7823a99269f8 100644
--- a/chrome/browser/resources/options/automatic_settings_reset_banner.js
+++ b/chrome/browser/resources/options/automatic_settings_reset_banner.js
@@ -11,7 +11,6 @@ cr.define('options', function() {
* AutomaticSettingsResetBanner class
* Provides encapsulated handling of the Reset Profile Settings banner.
* @constructor
- * @extends {options.SettingsBannerBase}
*/
function AutomaticSettingsResetBanner() {}
@@ -31,13 +30,13 @@ cr.define('options', function() {
* our show() method. This would mean that the banner would be first
* dismissed, then shown. We want to prevent this.
*
- * @type {boolean}
- * @private
+ * @private {boolean}
*/
- hadBeenDismissed_: false,
+ wasDismissed_: false,
/**
* Metric name to send when a show event occurs.
+ * @private {string}
*/
showMetricName_: '',
@@ -48,8 +47,9 @@ cr.define('options', function() {
/**
* DOM element whose visibility is set when setVisibility_ is called.
+ * @private {HTMLElement}
Dan Beam 2015/11/18 17:38:22 nit: ?HTMLElement
robertshield 2015/11/19 00:04:45 Done.
*/
- setVisibilibyDomElement_: null,
+ visibleElement_: null,
/**
* Initializes the banner's event handlers.
@@ -66,7 +66,7 @@ cr.define('options', function() {
this.dismissNativeCallbackName_ =
'onDismissedAutomaticSettingsResetBanner';
- this.setVisibilibyDomElement_ = $('automatic-settings-reset-banner');
+ this.visibleElement_ = $('automatic-settings-reset-banner');
Dan Beam 2015/11/18 17:38:22 nit: this.visibleElement_ = getRequiredElement('a
robertshield 2015/11/19 00:04:44 Done.
$('automatic-settings-reset-banner-close').onclick = function(event) {
chrome.send('metricsHandler:recordAction',
@@ -91,7 +91,7 @@ cr.define('options', function() {
* @protected
*/
setVisibility: function(show) {
- this.setVisibilibyDomElement_.hidden = !show;
+ this.visibleElement_.hidden = !show;
},
/**
@@ -99,7 +99,7 @@ cr.define('options', function() {
* @private
*/
show_: function() {
- if (!this.hadBeenDismissed_) {
+ if (!this.wasDismissed_) {
chrome.send('metricsHandler:recordAction', [this.showMetricName_]);
this.setVisibility(true);
}
@@ -112,8 +112,9 @@ cr.define('options', function() {
* @private
*/
dismiss_: function() {
+ assert(this.dismissNativeCallbackName_);
chrome.send(this.dismissNativeCallbackName_);
Dan Beam 2015/11/18 17:38:22 nit: chrome.send(assert(this.dismissNativeCallback
robertshield 2015/11/19 00:04:45 Done.
- this.hadBeenDismissed_ = true;
+ this.wasDismissed_ = true;
this.setVisibility(false);
},
};
« no previous file with comments | « chrome/browser/resources/options/automatic_settings_reset_banner.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698