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

Side by Side Diff: chrome/browser/resources/options/reset_profile_settings_banner.js

Issue 271673006: Eliminate all code related to the AutomaticProfileResetter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nit from dbeam@, using new tracked preference deprecation. Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Note: the native-side handler for this is ResetProfileSettingsHandler.
6
7 cr.define('options', function() {
8 /** @const */ var PageManager = cr.ui.pageManager.PageManager;
9 /** @const */ var SettingsBannerBase = options.SettingsBannerBase;
10
11 /**
12 * ResetProfileSettingsBanner class
13 * Provides encapsulated handling of the Reset Profile Settings banner.
14 * @constructor
15 */
16 function ResetProfileSettingsBanner() {}
17
18 cr.addSingletonGetter(ResetProfileSettingsBanner);
19
20 ResetProfileSettingsBanner.prototype = {
21 __proto__: SettingsBannerBase.prototype,
22
23 /**
24 * Initializes the banner's event handlers.
25 */
26 initialize: function() {
27 this.showMetricName_ = 'AutomaticReset_WebUIBanner_BannerShown';
28
29 this.dismissNativeCallbackName_ =
30 'onDismissedResetProfileSettingsBanner';
31
32 this.setVisibilibyDomElement_ = $('reset-profile-settings-banner');
33
34 $('reset-profile-settings-banner-close').onclick = function(event) {
35 chrome.send('metricsHandler:recordAction',
36 ['AutomaticReset_WebUIBanner_ManuallyClosed']);
37 ResetProfileSettingsBanner.dismiss();
38 };
39 $('reset-profile-settings-banner-activate').onclick = function(event) {
40 chrome.send('metricsHandler:recordAction',
41 ['AutomaticReset_WebUIBanner_ResetClicked']);
42 PageManager.showPageByName('resetProfileSettings');
43 };
44 },
45 };
46
47 // Forward public APIs to private implementations.
48 [
49 'show',
50 'dismiss',
51 ].forEach(function(name) {
52 ResetProfileSettingsBanner[name] = function() {
53 var instance = ResetProfileSettingsBanner.getInstance();
54 return instance[name + '_'].apply(instance, arguments);
55 };
56 });
57
58 // Export
59 return {
60 ResetProfileSettingsBanner: ResetProfileSettingsBanner
61 };
62 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698