Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: chrome/browser/resources/extensions/extension_commands_overlay.js

Issue 512003002: Revert of Revert "Typecheck JS files for chrome://extensions" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/extensions/extension_command_list.js ('k') | chrome/browser/resources/extensions/extension_error.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698