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

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: Dan's feedback. 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..5755d802034101e70e50c6c4f3e0496722b3fed6 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}
*/
- setVisibilibyDomElement_: null,
+ visibleElement_: null,
/**
* Initializes the banner's event handlers.
@@ -66,7 +66,8 @@ cr.define('options', function() {
this.dismissNativeCallbackName_ =
'onDismissedAutomaticSettingsResetBanner';
- this.setVisibilibyDomElement_ = $('automatic-settings-reset-banner');
+ this.visibleElement_ = getRequiredElement(
+ 'automatic-settings-reset-banner');
$('automatic-settings-reset-banner-close').onclick = function(event) {
chrome.send('metricsHandler:recordAction',
@@ -91,7 +92,7 @@ cr.define('options', function() {
* @protected
*/
setVisibility: function(show) {
- this.setVisibilibyDomElement_.hidden = !show;
+ this.visibleElement_.hidden = !show;
},
/**
@@ -99,7 +100,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 +113,8 @@ cr.define('options', function() {
* @private
*/
dismiss_: function() {
- chrome.send(this.dismissNativeCallbackName_);
- this.hadBeenDismissed_ = true;
+ chrome.send(assert(this.dismissNativeCallbackName_));
+ 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