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

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

Issue 566063002: Compile chrome://settings, part 8: the final battle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@H_options_errors_6
Patch Set: suppress Created 6 years, 2 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
« no previous file with comments | « third_party/closure_compiler/compiled_resources.gyp ('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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 commandManagers[uid] = new CommandManager(doc); 229 commandManagers[uid] = new CommandManager(doc);
230 } 230 }
231 }; 231 };
232 232
233 CommandManager.prototype = { 233 CommandManager.prototype = {
234 234
235 /** 235 /**
236 * Handles focus changes on the document. 236 * Handles focus changes on the document.
237 * @param {Event} e The focus event object. 237 * @param {Event} e The focus event object.
238 * @private 238 * @private
239 * @suppress {checkTypes}
240 * TODO(vitalyp): remove the suppression.
Dan Beam 2014/09/30 16:47:15 this is fine by me
239 */ 241 */
240 handleFocus_: function(e) { 242 handleFocus_: function(e) {
241 var target = e.target; 243 var target = e.target;
242 244
243 // Ignore focus on a menu button or command item 245 // Ignore focus on a menu button or command item.
244 if (target.menu || target.command) 246 if (target.menu || target.command)
245 return; 247 return;
246 248
247 var commands = Array.prototype.slice.call( 249 var commands = Array.prototype.slice.call(
248 target.ownerDocument.querySelectorAll('command')); 250 target.ownerDocument.querySelectorAll('command'));
249 251
250 commands.forEach(function(command) { 252 commands.forEach(function(command) {
251 dispatchCanExecuteEvent(command, target); 253 dispatchCanExecuteEvent(command, target);
252 }); 254 });
253 }, 255 },
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 this.stopPropagation(); 319 this.stopPropagation();
318 } 320 }
319 }; 321 };
320 322
321 // Export 323 // Export
322 return { 324 return {
323 Command: Command, 325 Command: Command,
324 CanExecuteEvent: CanExecuteEvent 326 CanExecuteEvent: CanExecuteEvent
325 }; 327 };
326 }); 328 });
OLDNEW
« no previous file with comments | « third_party/closure_compiler/compiled_resources.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698