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('extensions', function() { | 5 cr.define('extensions', function() { |
6 /** | 6 /** |
7 * PackExtensionOverlay class | 7 * PackExtensionOverlay class |
8 * Encapsulated handling of the 'Pack Extension' overlay page. | 8 * Encapsulated handling of the 'Pack Extension' overlay page. |
9 * @constructor | 9 * @constructor |
10 */ | 10 */ |
11 function PackExtensionOverlay() { | 11 function PackExtensionOverlay() { |
12 } | 12 } |
13 | 13 |
14 cr.addSingletonGetter(PackExtensionOverlay); | 14 cr.addSingletonGetter(PackExtensionOverlay); |
15 | 15 |
16 PackExtensionOverlay.prototype = { | 16 PackExtensionOverlay.prototype = { |
17 /** | 17 /** |
18 * Initialize the page. | 18 * Initialize the page. |
19 */ | 19 */ |
20 initializePage: function() { | 20 initializePage: function() { |
21 var overlay = $('overlay'); | 21 var overlay = $('overlay'); |
22 cr.ui.overlay.setupOverlay(overlay); | 22 cr.ui.overlay.setupOverlay(overlay); |
23 cr.ui.overlay.globalInitialization(); | 23 cr.ui.overlay.globalInitialization(); |
24 overlay.addEventListener('cancelOverlay', this.handleDismiss_.bind(this)); | 24 overlay.addEventListener('cancelOverlay', this.handleDismiss_.bind(this)); |
25 | 25 |
26 $('pack-extension-dismiss').addEventListener('click', | 26 $('pack-extension-dismiss').addEventListener('click', function() { |
27 this.handleDismiss_.bind(this)); | 27 cr.dispatchSimpleEvent(overlay, 'cancelOverlay'); |
| 28 }); |
28 $('pack-extension-commit').addEventListener('click', | 29 $('pack-extension-commit').addEventListener('click', |
29 this.handleCommit_.bind(this)); | 30 this.handleCommit_.bind(this)); |
30 $('browse-extension-dir').addEventListener('click', | 31 $('browse-extension-dir').addEventListener('click', |
31 this.handleBrowseExtensionDir_.bind(this)); | 32 this.handleBrowseExtensionDir_.bind(this)); |
32 $('browse-private-key').addEventListener('click', | 33 $('browse-private-key').addEventListener('click', |
33 this.handleBrowsePrivateKey_.bind(this)); | 34 this.handleBrowsePrivateKey_.bind(this)); |
34 }, | 35 }, |
35 | 36 |
36 /** | 37 /** |
37 * Handles a click on the dismiss button. | 38 * Handles a click on the dismiss button. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 alertCancelCallback); | 159 alertCancelCallback); |
159 extensions.ExtensionSettings.showOverlay($('alertOverlay')); | 160 extensions.ExtensionSettings.showOverlay($('alertOverlay')); |
160 }, | 161 }, |
161 }; | 162 }; |
162 | 163 |
163 // Export | 164 // Export |
164 return { | 165 return { |
165 PackExtensionOverlay: PackExtensionOverlay | 166 PackExtensionOverlay: PackExtensionOverlay |
166 }; | 167 }; |
167 }); | 168 }); |
OLD | NEW |