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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 }; | 42 }; |
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 /** | |
53 * Fake declaration made for Closure Compiler. Actual method definition is | |
54 * in the base class. | |
55 * @private | |
56 */ | |
57 AutomaticSettingsResetBanner.prototype.show_; | |
58 | |
59 /** | |
60 * Fake declaration made for Closure Compiler. Actual method definition is | |
61 * in the base class. | |
62 * @private | |
63 */ | |
64 AutomaticSettingsResetBanner.prototype.dismiss_; | |
Vitaly Pavlenko
2014/09/12 18:38:07
Moved here declarations from base class.
| |
65 | |
52 // Forward public APIs to private implementations. | 66 // Forward public APIs to private implementations. |
53 [ | 67 cr.makePublic(AutomaticSettingsResetBanner, [ |
54 'show', | 68 'show', |
55 'dismiss', | 69 'dismiss', |
56 ].forEach(function(name) { | 70 ]); |
57 AutomaticSettingsResetBanner[name] = function() { | |
58 var instance = AutomaticSettingsResetBanner.getInstance(); | |
59 return instance[name + '_'].apply(instance, arguments); | |
60 }; | |
61 }); | |
62 | 71 |
63 // Export | 72 // Export |
64 return { | 73 return { |
65 AutomaticSettingsResetBanner: AutomaticSettingsResetBanner | 74 AutomaticSettingsResetBanner: AutomaticSettingsResetBanner |
66 }; | 75 }; |
67 }); | 76 }); |
OLD | NEW |