| 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 OptionsPage = options.OptionsPage; | 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 */ | 15 */ |
| 16 function ResetProfileSettingsBanner() {} | 16 function ResetProfileSettingsBanner() {} |
| 17 | 17 |
| 18 cr.addSingletonGetter(ResetProfileSettingsBanner); | 18 cr.addSingletonGetter(ResetProfileSettingsBanner); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 32 this.setVisibilibyDomElement_ = $('reset-profile-settings-banner'); | 32 this.setVisibilibyDomElement_ = $('reset-profile-settings-banner'); |
| 33 | 33 |
| 34 $('reset-profile-settings-banner-close').onclick = function(event) { | 34 $('reset-profile-settings-banner-close').onclick = function(event) { |
| 35 chrome.send('metricsHandler:recordAction', | 35 chrome.send('metricsHandler:recordAction', |
| 36 ['AutomaticReset_WebUIBanner_ManuallyClosed']); | 36 ['AutomaticReset_WebUIBanner_ManuallyClosed']); |
| 37 ResetProfileSettingsBanner.dismiss(); | 37 ResetProfileSettingsBanner.dismiss(); |
| 38 }; | 38 }; |
| 39 $('reset-profile-settings-banner-activate').onclick = function(event) { | 39 $('reset-profile-settings-banner-activate').onclick = function(event) { |
| 40 chrome.send('metricsHandler:recordAction', | 40 chrome.send('metricsHandler:recordAction', |
| 41 ['AutomaticReset_WebUIBanner_ResetClicked']); | 41 ['AutomaticReset_WebUIBanner_ResetClicked']); |
| 42 OptionsPage.navigateToPage('resetProfileSettings'); | 42 PageManager.showPageByName('resetProfileSettings'); |
| 43 }; | 43 }; |
| 44 }, | 44 }, |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 // Forward public APIs to private implementations. | 47 // Forward public APIs to private implementations. |
| 48 [ | 48 [ |
| 49 'show', | 49 'show', |
| 50 'dismiss', | 50 'dismiss', |
| 51 ].forEach(function(name) { | 51 ].forEach(function(name) { |
| 52 ResetProfileSettingsBanner[name] = function() { | 52 ResetProfileSettingsBanner[name] = function() { |
| 53 var instance = ResetProfileSettingsBanner.getInstance(); | 53 var instance = ResetProfileSettingsBanner.getInstance(); |
| 54 return instance[name + '_'].apply(instance, arguments); | 54 return instance[name + '_'].apply(instance, arguments); |
| 55 }; | 55 }; |
| 56 }); | 56 }); |
| 57 | 57 |
| 58 // Export | 58 // Export |
| 59 return { | 59 return { |
| 60 ResetProfileSettingsBanner: ResetProfileSettingsBanner | 60 ResetProfileSettingsBanner: ResetProfileSettingsBanner |
| 61 }; | 61 }; |
| 62 }); | 62 }); |
| OLD | NEW |