| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 ResetProfileSettingsHandler. | 5 // Note: the native-side handler for this is ResetProfileSettingsHandler. |
| 6 | 6 |
| 7 cr.define('options', function() { | 7 cr.define('options', function() { |
| 8 /** @const */ var PageManager = cr.ui.pageManager.PageManager; | 8 /** @const */ var PageManager = cr.ui.pageManager.PageManager; |
| 9 /** @const */ var SettingsBannerBase = options.SettingsBannerBase; | 9 /** @const */ var SettingsBannerBase = options.SettingsBannerBase; |
| 10 | 10 |
| 11 /** | 11 /** |
| 12 * ResetProfileSettingsBanner class | 12 * ResetProfileSettingsBanner 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 */ | 16 */ |
| 16 function ResetProfileSettingsBanner() {} | 17 function ResetProfileSettingsBanner() {} |
| 17 | 18 |
| 18 cr.addSingletonGetter(ResetProfileSettingsBanner); | 19 cr.addSingletonGetter(ResetProfileSettingsBanner); |
| 19 | 20 |
| 20 ResetProfileSettingsBanner.prototype = { | 21 ResetProfileSettingsBanner.prototype = { |
| 21 __proto__: SettingsBannerBase.prototype, | 22 __proto__: SettingsBannerBase.prototype, |
| 22 | 23 |
| 23 /** | 24 /** |
| 24 * Initializes the banner's event handlers. | 25 * Initializes the banner's event handlers. |
| 26 * @suppress {checkTypes} |
| 27 * TODO(vitalyp): remove the suppression. |
| 25 */ | 28 */ |
| 26 initialize: function() { | 29 initialize: function() { |
| 27 this.showMetricName = 'AutomaticReset_WebUIBanner_BannerShown'; | 30 this.showMetricName = 'AutomaticReset_WebUIBanner_BannerShown'; |
| 28 | 31 |
| 29 this.dismissNativeCallbackName = | 32 this.dismissNativeCallbackName = |
| 30 'onDismissedResetProfileSettingsBanner'; | 33 'onDismissedResetProfileSettingsBanner'; |
| 31 | 34 |
| 32 this.visibilityDomElement = $('reset-profile-settings-banner'); | 35 this.visibilityDomElement = $('reset-profile-settings-banner'); |
| 33 | 36 |
| 34 $('reset-profile-settings-banner-close').onclick = function(event) { | 37 $('reset-profile-settings-banner-close').onclick = function(event) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 53 var instance = ResetProfileSettingsBanner.getInstance(); | 56 var instance = ResetProfileSettingsBanner.getInstance(); |
| 54 return instance[name].apply(instance, arguments); | 57 return instance[name].apply(instance, arguments); |
| 55 }; | 58 }; |
| 56 }); | 59 }); |
| 57 | 60 |
| 58 // Export | 61 // Export |
| 59 return { | 62 return { |
| 60 ResetProfileSettingsBanner: ResetProfileSettingsBanner | 63 ResetProfileSettingsBanner: ResetProfileSettingsBanner |
| 61 }; | 64 }; |
| 62 }); | 65 }); |
| OLD | NEW |