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"></include> | 5 <include src="extension_command_list.js"></include> |
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 13 matching lines...) Expand all Loading... |
24 ExtensionCommandsOverlay.prototype = { | 24 ExtensionCommandsOverlay.prototype = { |
25 /** | 25 /** |
26 * Initialize the page. | 26 * Initialize the page. |
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 $('extensionCommandsDismiss').addEventListener('click', | 34 $('extension-commands-dismiss').addEventListener('click', |
35 this.handleDismiss_.bind(this)); | 35 this.handleDismiss_.bind(this)); |
36 | 36 |
37 // This will request the data to show on the page and will get a response | 37 // This will request the data to show on the page and will get a response |
38 // back in returnExtensionsData. | 38 // back in returnExtensionsData. |
39 chrome.send('extensionCommandsRequestExtensionsData'); | 39 chrome.send('extensionCommandsRequestExtensionsData'); |
40 }, | 40 }, |
41 | 41 |
42 /** | 42 /** |
43 * Handles a click on the dismiss button. | 43 * Handles a click on the dismiss button. |
44 * @param {Event} e The click event. | 44 * @param {Event} e The click event. |
45 */ | 45 */ |
46 handleDismiss_: function(e) { | 46 handleDismiss_: function(e) { |
47 ExtensionSettings.showOverlay(null); | 47 extensions.ExtensionSettings.showOverlay(null); |
48 }, | 48 }, |
49 }; | 49 }; |
50 | 50 |
51 /** | 51 /** |
52 * Called by the dom_ui_ to re-populate the page with data representing | 52 * Called by the dom_ui_ to re-populate the page with data representing |
53 * the current state of extension commands. | 53 * the current state of extension commands. |
54 */ | 54 */ |
55 ExtensionCommandsOverlay.returnExtensionsData = function(extensionsData) { | 55 ExtensionCommandsOverlay.returnExtensionsData = function(extensionsData) { |
56 ExtensionCommandList.prototype.data_ = extensionsData; | 56 ExtensionCommandList.prototype.data_ = extensionsData; |
57 var extensionCommandList = $('extension-command-list'); | 57 var extensionCommandList = $('extension-command-list'); |
(...skipping 10 matching lines...) Expand all Loading... |
68 list.classList.add('empty-extension-commands-list'); | 68 list.classList.add('empty-extension-commands-list'); |
69 else | 69 else |
70 list.classList.remove('empty-extension-commands-list'); | 70 list.classList.remove('empty-extension-commands-list'); |
71 } | 71 } |
72 | 72 |
73 // Export | 73 // Export |
74 return { | 74 return { |
75 ExtensionCommandsOverlay: ExtensionCommandsOverlay | 75 ExtensionCommandsOverlay: ExtensionCommandsOverlay |
76 }; | 76 }; |
77 }); | 77 }); |
78 | |
79 // Update the C++ call so this isn't necessary. | |
80 var ExtensionCommandsOverlay = extensions.ExtensionCommandsOverlay; | |
OLD | NEW |