Chromium Code Reviews| 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 <include src="extension_command_list.js"> | 5 <include src="extension_command_list.js"> |
| 6 | 6 |
| 7 cr.define('extensions', function() { | 7 cr.define('extensions', function() { |
| 8 'use strict'; | 8 'use strict'; |
| 9 | 9 |
| 10 // The Extension Commands list object that will be used to show the commands | 10 // The Extension Commands list object that will be used to show the commands |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 */ | 27 */ |
| 28 initializePage: function() { | 28 initializePage: function() { |
| 29 var overlay = $('overlay'); | 29 var overlay = $('overlay'); |
| 30 cr.ui.overlay.setupOverlay(overlay); | 30 cr.ui.overlay.setupOverlay(overlay); |
| 31 cr.ui.overlay.globalInitialization(); | 31 cr.ui.overlay.globalInitialization(); |
| 32 overlay.addEventListener('cancelOverlay', this.handleDismiss_.bind(this)); | 32 overlay.addEventListener('cancelOverlay', this.handleDismiss_.bind(this)); |
| 33 | 33 |
| 34 this.extensionCommandList_ = new ExtensionCommandList( | 34 this.extensionCommandList_ = new ExtensionCommandList( |
| 35 /**@type {HTMLDivElement} */($('extension-command-list'))); | 35 /**@type {HTMLDivElement} */($('extension-command-list'))); |
| 36 | 36 |
| 37 $('extension-commands-dismiss').addEventListener('click', | 37 $('extension-commands-dismiss').addEventListener('click', function() { |
| 38 this.handleDismiss_.bind(this)); | 38 cr.dispatchEvent(overlay, 'cancelOverlay'); |
|
Dan Beam
2015/06/04 03:30:29
this was short-circuiting the focus restoration co
|
dmazzoni
2015/06/04 03:34:56
Just curious, is there a reason this is dispatchEv
Dan Beam
2015/06/04 18:50:35
Done. (and closure compiled for first time and act
|
| 39 }); | |
| 39 | 40 |
| 40 // The ExtensionList will update us with its data, so we don't need to | 41 // The ExtensionList will update us with its data, so we don't need to |
| 41 // handle that here. | 42 // handle that here. |
| 42 }, | 43 }, |
| 43 | 44 |
| 44 /** | 45 /** |
| 45 * Handles a click on the dismiss button. | 46 * Handles a click on the dismiss button. |
| 46 * @param {Event} e The click event. | 47 * @param {Event} e The click event. |
| 47 */ | 48 */ |
| 48 handleDismiss_: function(e) { | 49 handleDismiss_: function(e) { |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 75 $('no-commands').hidden = hasAnyCommands; | 76 $('no-commands').hidden = hasAnyCommands; |
| 76 overlay.extensionCommandList_.classList.toggle( | 77 overlay.extensionCommandList_.classList.toggle( |
| 77 'empty-extension-commands-list', !hasAnyCommands); | 78 'empty-extension-commands-list', !hasAnyCommands); |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 // Export | 81 // Export |
| 81 return { | 82 return { |
| 82 ExtensionCommandsOverlay: ExtensionCommandsOverlay | 83 ExtensionCommandsOverlay: ExtensionCommandsOverlay |
| 83 }; | 84 }; |
| 84 }); | 85 }); |
| OLD | NEW |