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 PageManager = cr.ui.pageManager.PageManager; | 8 /** @const */ var PageManager = cr.ui.pageManager.PageManager; |
9 | 9 |
10 /** | 10 /** |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 * via "Forward public APIs to protected implementations" pattern (see | 59 * via "Forward public APIs to protected implementations" pattern (see |
60 * below). Currently the compiler pass and cr.js handles only forwarding to | 60 * below). Currently the compiler pass and cr.js handles only forwarding to |
61 * private implementations using cr.makePublic(). | 61 * private implementations using cr.makePublic(). |
62 */ | 62 */ |
63 initialize: function() { | 63 initialize: function() { |
64 this.showMetricName_ = 'AutomaticSettingsReset_WebUIBanner_BannerShown'; | 64 this.showMetricName_ = 'AutomaticSettingsReset_WebUIBanner_BannerShown'; |
65 | 65 |
66 this.dismissNativeCallbackName_ = | 66 this.dismissNativeCallbackName_ = |
67 'onDismissedAutomaticSettingsResetBanner'; | 67 'onDismissedAutomaticSettingsResetBanner'; |
68 | 68 |
69 this.visibleElement_ = getRequiredElement( | 69 this.visibleElement_ = |
70 'automatic-settings-reset-banner'); | 70 getRequiredElement('automatic-settings-reset-banner'); |
71 | 71 |
72 $('automatic-settings-reset-banner-close').onclick = function(event) { | 72 $('automatic-settings-reset-banner-close').onclick = function(event) { |
73 chrome.send('metricsHandler:recordAction', | 73 chrome.send( |
| 74 'metricsHandler:recordAction', |
74 ['AutomaticSettingsReset_WebUIBanner_ManuallyClosed']); | 75 ['AutomaticSettingsReset_WebUIBanner_ManuallyClosed']); |
75 AutomaticSettingsResetBanner.dismiss(); | 76 AutomaticSettingsResetBanner.dismiss(); |
76 }; | 77 }; |
77 $('automatic-settings-reset-learn-more').onclick = function(event) { | 78 $('automatic-settings-reset-learn-more').onclick = function(event) { |
78 chrome.send('metricsHandler:recordAction', | 79 chrome.send( |
| 80 'metricsHandler:recordAction', |
79 ['AutomaticSettingsReset_WebUIBanner_LearnMoreClicked']); | 81 ['AutomaticSettingsReset_WebUIBanner_LearnMoreClicked']); |
80 }; | 82 }; |
81 $('automatic-settings-reset-banner-activate-reset').onclick = | 83 $('automatic-settings-reset-banner-activate-reset').onclick = function( |
82 function(event) { | 84 event) { |
83 chrome.send('metricsHandler:recordAction', | 85 chrome.send( |
| 86 'metricsHandler:recordAction', |
84 ['AutomaticSettingsReset_WebUIBanner_ResetClicked']); | 87 ['AutomaticSettingsReset_WebUIBanner_ResetClicked']); |
85 PageManager.showPageByName('resetProfileSettings'); | 88 PageManager.showPageByName('resetProfileSettings'); |
86 }; | 89 }; |
87 }, | 90 }, |
88 | 91 |
89 /** | 92 /** |
90 * Sets whether or not the reset profile settings banner shall be visible. | 93 * Sets whether or not the reset profile settings banner shall be visible. |
91 * @param {boolean} show Whether or not to show the banner. | 94 * @param {boolean} show Whether or not to show the banner. |
92 * @protected | 95 * @protected |
93 */ | 96 */ |
(...skipping 25 matching lines...) Expand all Loading... |
119 }, | 122 }, |
120 }; | 123 }; |
121 | 124 |
122 // Forward public APIs to private implementations. | 125 // Forward public APIs to private implementations. |
123 cr.makePublic(AutomaticSettingsResetBanner, [ | 126 cr.makePublic(AutomaticSettingsResetBanner, [ |
124 'show', | 127 'show', |
125 'dismiss', | 128 'dismiss', |
126 ]); | 129 ]); |
127 | 130 |
128 // Export | 131 // Export |
129 return { | 132 return {AutomaticSettingsResetBanner: AutomaticSettingsResetBanner}; |
130 AutomaticSettingsResetBanner: AutomaticSettingsResetBanner | |
131 }; | |
132 }); | 133 }); |
OLD | NEW |