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 * AlertOverlay class | 9 * AlertOverlay class |
10 * Encapsulated handling of a generic alert. | 10 * Encapsulated handling of a generic alert. |
(...skipping 26 matching lines...) Expand all Loading... |
37 var self = this; | 37 var self = this; |
38 $('alertOverlayOk').onclick = function(event) { | 38 $('alertOverlayOk').onclick = function(event) { |
39 self.handleOK_(); | 39 self.handleOK_(); |
40 }; | 40 }; |
41 | 41 |
42 $('alertOverlayCancel').onclick = function(event) { | 42 $('alertOverlayCancel').onclick = function(event) { |
43 self.handleCancel_(); | 43 self.handleCancel_(); |
44 }; | 44 }; |
45 }, | 45 }, |
46 | 46 |
| 47 /** @inheritDoc */ |
| 48 get nestingLevel() { |
| 49 // AlertOverlay is special in that it is not tied to one page or overlay. |
| 50 // Set the nesting level arbitrarily high so as to always be recognized as |
| 51 // the top-most visible page. |
| 52 return 99; |
| 53 }, |
| 54 |
47 /** | 55 /** |
48 * Handle the 'ok' button. Clear the overlay and call the ok callback if | 56 * Handle the 'ok' button. Clear the overlay and call the ok callback if |
49 * available. | 57 * available. |
50 * @private | 58 * @private |
51 */ | 59 */ |
52 handleOK_: function() { | 60 handleOK_: function() { |
53 OptionsPage.closeOverlay(); | 61 OptionsPage.closeOverlay(); |
54 if (this.okCallback != undefined) { | 62 if (this.okCallback != undefined) { |
55 this.okCallback.call(); | 63 this.okCallback.call(); |
56 } | 64 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // Intentionally don't show the URL in the location bar as we don't want | 143 // Intentionally don't show the URL in the location bar as we don't want |
136 // people trying to navigate here by hand. | 144 // people trying to navigate here by hand. |
137 OptionsPage.showPageByName('alertOverlay', false); | 145 OptionsPage.showPageByName('alertOverlay', false); |
138 }; | 146 }; |
139 | 147 |
140 // Export | 148 // Export |
141 return { | 149 return { |
142 AlertOverlay: AlertOverlay | 150 AlertOverlay: AlertOverlay |
143 }; | 151 }; |
144 }); | 152 }); |
OLD | NEW |