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

Side by Side Diff: ui/webui/resources/js/cr/ui/command.js

Issue 722953002: downloads: add the ability to undo download removal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fixes Created 6 years 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
« no previous file with comments | « chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 5 /**
6 * @fileoverview A command is an abstraction of an action a user can do in the 6 * @fileoverview A command is an abstraction of an action a user can do in the
7 * UI. 7 * UI.
8 * 8 *
9 * When the focus changes in the document for each command a canExecute event 9 * When the focus changes in the document for each command a canExecute event
10 * is dispatched on the active element. By listening to this event you can 10 * is dispatched on the active element. By listening to this event you can
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 * Whether the event object matches the shortcut for this command. 150 * Whether the event object matches the shortcut for this command.
151 * @param {!Event} e The key event object. 151 * @param {!Event} e The key event object.
152 * @return {boolean} Whether it matched or not. 152 * @return {boolean} Whether it matched or not.
153 */ 153 */
154 matchesEvent: function(e) { 154 matchesEvent: function(e) {
155 if (!this.keyboardShortcuts_) 155 if (!this.keyboardShortcuts_)
156 return false; 156 return false;
157 157
158 return this.keyboardShortcuts_.some(function(keyboardShortcut) { 158 return this.keyboardShortcuts_.some(function(keyboardShortcut) {
159 return keyboardShortcut.matchesEvent(e); 159 return keyboardShortcut.matchesEvent(e);
160 }); 160 });
161 } 161 },
162 }; 162 };
163 163
164 /** 164 /**
165 * The label of the command. 165 * The label of the command.
166 */ 166 */
167 cr.defineProperty(Command, 'label', cr.PropertyKind.ATTR); 167 cr.defineProperty(Command, 'label', cr.PropertyKind.ATTR);
168 168
169 /** 169 /**
170 * Whether the command is disabled or not. 170 * Whether the command is disabled or not.
171 */ 171 */
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 this.preventDefault(); 321 this.preventDefault();
322 } 322 }
323 }; 323 };
324 324
325 // Export 325 // Export
326 return { 326 return {
327 Command: Command, 327 Command: Command,
328 CanExecuteEvent: CanExecuteEvent 328 CanExecuteEvent: CanExecuteEvent
329 }; 329 };
330 }); 330 });
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698