OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Note: the native-side handler for this is AutomaticSettingsResetHandler. | 5 // Note: the native-side handler for this is AutomaticSettingsResetHandler. |
6 | 6 |
7 cr.define('options', function() { | 7 cr.define('options', function() { |
8 /** @const */ var SettingsBannerBase = options.SettingsBannerBase; | 8 /** @const */ var SettingsBannerBase = options.SettingsBannerBase; |
9 /** @const */ var PageManager = cr.ui.pageManager.PageManager; | 9 /** @const */ var PageManager = cr.ui.pageManager.PageManager; |
10 | 10 |
11 /** | 11 /** |
12 * AutomaticSettingsResetBanner class | 12 * AutomaticSettingsResetBanner class |
13 * Provides encapsulated handling of the Reset Profile Settings banner. | 13 * Provides encapsulated handling of the Reset Profile Settings banner. |
14 * @constructor | 14 * @constructor |
15 * @extends {options.SettingsBannerBase} | 15 * @extends {options.SettingsBannerBase} |
16 */ | 16 */ |
17 function AutomaticSettingsResetBanner() {} | 17 function AutomaticSettingsResetBanner() {} |
18 | 18 |
19 cr.addSingletonGetter(AutomaticSettingsResetBanner); | 19 cr.addSingletonGetter(AutomaticSettingsResetBanner); |
20 | 20 |
21 AutomaticSettingsResetBanner.prototype = { | 21 AutomaticSettingsResetBanner.prototype = { |
22 __proto__: SettingsBannerBase.prototype, | 22 __proto__: SettingsBannerBase.prototype, |
23 | 23 |
24 /** | 24 /** |
25 * Initializes the banner's event handlers. | 25 * Initializes the banner's event handlers. |
26 * @suppress {checkTypes} | |
27 * TODO(vitalyp): remove the suppression. | |
Dan Beam
2014/10/01 23:25:45
why?
Vitaly Pavlenko
2014/10/01 23:38:17
Method AutomaticSettingsResetBanner.dismiss() is d
| |
26 */ | 28 */ |
27 initialize: function() { | 29 initialize: function() { |
28 this.showMetricName = 'AutomaticSettingsReset_WebUIBanner_BannerShown'; | 30 this.showMetricName = 'AutomaticSettingsReset_WebUIBanner_BannerShown'; |
29 | 31 |
30 this.dismissNativeCallbackName = | 32 this.dismissNativeCallbackName = |
31 'onDismissedAutomaticSettingsResetBanner'; | 33 'onDismissedAutomaticSettingsResetBanner'; |
32 | 34 |
33 this.visibilityDomElement = $('automatic-settings-reset-banner'); | 35 this.visibilityDomElement = $('automatic-settings-reset-banner'); |
34 | 36 |
35 $('automatic-settings-reset-banner-close').onclick = function(event) { | 37 $('automatic-settings-reset-banner-close').onclick = function(event) { |
(...skipping 23 matching lines...) Expand all Loading... | |
59 var instance = AutomaticSettingsResetBanner.getInstance(); | 61 var instance = AutomaticSettingsResetBanner.getInstance(); |
60 return instance[name].apply(instance, arguments); | 62 return instance[name].apply(instance, arguments); |
61 }; | 63 }; |
62 }); | 64 }); |
63 | 65 |
64 // Export | 66 // Export |
65 return { | 67 return { |
66 AutomaticSettingsResetBanner: AutomaticSettingsResetBanner | 68 AutomaticSettingsResetBanner: AutomaticSettingsResetBanner |
67 }; | 69 }; |
68 }); | 70 }); |
OLD | NEW |