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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 extensions.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 * @param {!{commands: Array.<{name: string, id: string, commands: ?Array}>}} |
| 55 * extensionsData |
54 */ | 56 */ |
55 ExtensionCommandsOverlay.returnExtensionsData = function(extensionsData) { | 57 ExtensionCommandsOverlay.returnExtensionsData = function(extensionsData) { |
56 ExtensionCommandList.prototype.data_ = extensionsData; | 58 ExtensionCommandList.prototype.data_ = extensionsData; |
57 var extensionCommandList = $('extension-command-list'); | 59 var extensionCommandList = $('extension-command-list'); |
58 ExtensionCommandList.decorate(extensionCommandList); | 60 ExtensionCommandList.decorate(extensionCommandList); |
59 | 61 |
60 // Make sure the config link is visible, since there are commands to show | 62 // Make sure the config link is visible, since there are commands to show |
61 // and potentially configure. | 63 // and potentially configure. |
62 document.querySelector('.extension-commands-config').hidden = | 64 document.querySelector('.extension-commands-config').hidden = |
63 extensionsData.commands.length == 0; | 65 extensionsData.commands.length == 0; |
64 | 66 |
65 $('no-commands').hidden = extensionsData.commands.length > 0; | 67 $('no-commands').hidden = extensionsData.commands.length > 0; |
66 var list = $('extension-command-list'); | 68 var list = $('extension-command-list'); |
67 if (extensionsData.commands.length == 0) | 69 if (extensionsData.commands.length == 0) |
68 list.classList.add('empty-extension-commands-list'); | 70 list.classList.add('empty-extension-commands-list'); |
69 else | 71 else |
70 list.classList.remove('empty-extension-commands-list'); | 72 list.classList.remove('empty-extension-commands-list'); |
71 } | 73 }; |
72 | 74 |
73 // Export | 75 // Export |
74 return { | 76 return { |
75 ExtensionCommandsOverlay: ExtensionCommandsOverlay | 77 ExtensionCommandsOverlay: ExtensionCommandsOverlay |
76 }; | 78 }; |
77 }); | 79 }); |
OLD | NEW |