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