| 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 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 $('automatic-settings-reset-banner-activate-reset').onclick = | 43 $('automatic-settings-reset-banner-activate-reset').onclick = |
| 44 function(event) { | 44 function(event) { |
| 45 chrome.send('metricsHandler:recordAction', | 45 chrome.send('metricsHandler:recordAction', |
| 46 ['AutomaticSettingsReset_WebUIBanner_ResetClicked']); | 46 ['AutomaticSettingsReset_WebUIBanner_ResetClicked']); |
| 47 PageManager.showPageByName('resetProfileSettings'); | 47 PageManager.showPageByName('resetProfileSettings'); |
| 48 }; | 48 }; |
| 49 }, | 49 }, |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 // Forward public APIs to private implementations. | 52 // Forward public APIs to private implementations. |
| 53 [ | 53 cr.makePublic(AutomaticSettingsResetBanner, [ |
| 54 'show', | 54 'show', |
| 55 'dismiss', | 55 'dismiss', |
| 56 ].forEach(function(name) { | 56 ]); |
| 57 AutomaticSettingsResetBanner[name] = function() { | |
| 58 var instance = AutomaticSettingsResetBanner.getInstance(); | |
| 59 return instance[name + '_'].apply(instance, arguments); | |
| 60 }; | |
| 61 }); | |
| 62 | 57 |
| 63 // Export | 58 // Export |
| 64 return { | 59 return { |
| 65 AutomaticSettingsResetBanner: AutomaticSettingsResetBanner | 60 AutomaticSettingsResetBanner: AutomaticSettingsResetBanner |
| 66 }; | 61 }; |
| 67 }); | 62 }); |
| OLD | NEW |