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

Side by Side Diff: chrome/browser/resources/shared/js/cr/ui/command.js

Issue 3315005: NTP: Adds a context menu to the apps section... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 /** 275 /**
276 * Whether the target can execute the command. Setting this also stops the 276 * Whether the target can execute the command. Setting this also stops the
277 * propagation. 277 * propagation.
278 * @type {boolean} 278 * @type {boolean}
279 */ 279 */
280 canExecute_: false, 280 canExecute_: false,
281 get canExecute() { 281 get canExecute() {
282 return this.canExecute_; 282 return this.canExecute_;
283 }, 283 },
284 set canExecute(canExecute) { 284 set canExecute(canExecute) {
285 this.canExecute_ = canExecute; 285 this.canExecute_ = !!canExecute;
286 this.stopPropagation(); 286 this.stopPropagation();
287 } 287 }
288 }; 288 };
289 289
290 // Export 290 // Export
291 return { 291 return {
292 Command: Command, 292 Command: Command,
293 CanExecuteEvent: CanExecuteEvent 293 CanExecuteEvent: CanExecuteEvent
294 }; 294 };
295 }); 295 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/shared/css/menu.css ('k') | chrome/browser/resources/shared/js/cr/ui/position_util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698