OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 | 7 |
8 /** | 8 /** |
9 * ClearBrowserDataOverlay class | 9 * ClearBrowserDataOverlay class |
10 * Encapsulated handling of the 'Clear Browser Data' overlay page. | 10 * Encapsulated handling of the 'Clear Browser Data' overlay page. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 $('clear-browser-data-time-period').disabled = state; | 88 $('clear-browser-data-time-period').disabled = state; |
89 $('cbd-throbber').style.visibility = state ? 'visible' : 'hidden'; | 89 $('cbd-throbber').style.visibility = state ? 'visible' : 'hidden'; |
90 $('clear-browser-data-dismiss').disabled = state; | 90 $('clear-browser-data-dismiss').disabled = state; |
91 | 91 |
92 if (state) | 92 if (state) |
93 $('clear-browser-data-commit').disabled = true; | 93 $('clear-browser-data-commit').disabled = true; |
94 else | 94 else |
95 ClearBrowserDataOverlay.getInstance().updateCommitButtonState_(); | 95 ClearBrowserDataOverlay.getInstance().updateCommitButtonState_(); |
96 }; | 96 }; |
97 | 97 |
| 98 ClearBrowserDataOverlay.setBannerVisibility = function(args) { |
| 99 var visible = args[0]; |
| 100 $('info-banner').hidden = !visible; |
| 101 }; |
| 102 |
98 ClearBrowserDataOverlay.doneClearing = function() { | 103 ClearBrowserDataOverlay.doneClearing = function() { |
99 // The delay gives the user some feedback that the clearing | 104 // The delay gives the user some feedback that the clearing |
100 // actually worked. Otherwise the dialog just vanishes instantly in most | 105 // actually worked. Otherwise the dialog just vanishes instantly in most |
101 // cases. | 106 // cases. |
102 window.setTimeout(function() { | 107 window.setTimeout(function() { |
103 ClearBrowserDataOverlay.dismiss(); | 108 ClearBrowserDataOverlay.dismiss(); |
104 }, 200); | 109 }, 200); |
105 }; | 110 }; |
106 | 111 |
107 ClearBrowserDataOverlay.dismiss = function() { | 112 ClearBrowserDataOverlay.dismiss = function() { |
108 OptionsPage.closeOverlay(); | 113 OptionsPage.closeOverlay(); |
109 this.setClearingState(false); | 114 this.setClearingState(false); |
110 }; | 115 }; |
111 | 116 |
112 // Export | 117 // Export |
113 return { | 118 return { |
114 ClearBrowserDataOverlay: ClearBrowserDataOverlay | 119 ClearBrowserDataOverlay: ClearBrowserDataOverlay |
115 }; | 120 }; |
116 }); | 121 }); |
OLD | NEW |