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

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

Issue 533183002: Revert "Eliminate all code related to the AutomaticProfileResetter." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 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
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/resources/options/browser_options.html » ('j') | 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 3da6f5d791f04489167cbed5b311b03fd560dddd..b16f6cbe0694c5bedf05740a86af564ba33e771e 100644
--- a/chrome/browser/resources/options/automatic_settings_reset_banner.js
+++ b/chrome/browser/resources/options/automatic_settings_reset_banner.js
@@ -25,12 +25,12 @@ cr.define('options', function() {
* Initializes the banner's event handlers.
*/
initialize: function() {
- this.showMetricName_ = 'AutomaticSettingsReset_WebUIBanner_BannerShown';
+ this.showMetricName = 'AutomaticSettingsReset_WebUIBanner_BannerShown';
- this.dismissNativeCallbackName_ =
+ this.dismissNativeCallbackName =
'onDismissedAutomaticSettingsResetBanner';
- this.setVisibilibyDomElement_ = $('automatic-settings-reset-banner');
+ this.visibilityDomElement = $('automatic-settings-reset-banner');
$('automatic-settings-reset-banner-close').onclick = function(event) {
chrome.send('metricsHandler:recordAction',
@@ -48,36 +48,18 @@ cr.define('options', function() {
PageManager.showPageByName('resetProfileSettings');
};
},
-
- /**
- * Called by the native code to show the banner if needed.
- * @private
- */
- show_: function() {
- if (!this.hadBeenDismissed_) {
- chrome.send('metricsHandler:recordAction', [this.showMetricName_]);
- this.setVisibility(true);
- }
- },
-
- /**
- * Called when the banner should be closed as a result of something taking
- * place on the WebUI page, i.e. when its close button is pressed, or when
- * the confirmation dialog for the profile settings reset feature is opened.
- * @private
- */
- dismiss_: function() {
- chrome.send(this.dismissNativeCallbackName_);
- this.hadBeenDismissed_ = true;
- this.setVisibility(false);
- },
};
- // Forward public APIs to private implementations.
- cr.makePublic(AutomaticSettingsResetBanner, [
+ // Forward public APIs to protected implementations.
+ [
'show',
'dismiss',
- ]);
+ ].forEach(function(name) {
+ AutomaticSettingsResetBanner[name] = function() {
+ var instance = AutomaticSettingsResetBanner.getInstance();
+ return instance[name].apply(instance, arguments);
+ };
+ });
// Export
return {
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/resources/options/browser_options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698