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

Unified Diff: chrome/browser/resources/shared/js/cr/ui/menu_item.js

Issue 3453029: Add user customizable launch type for apps. (Closed)
Patch Set: No images this time. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/command.js ('k') | tools/grit/grit/format/html_inline.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/shared/js/cr/ui/menu_item.js
diff --git a/chrome/browser/resources/shared/js/cr/ui/menu_item.js b/chrome/browser/resources/shared/js/cr/ui/menu_item.js
index d570f7880977dbfc725d6c17c2cab4965e989ddc..c3e316932cc0c8a2ef4a942b057909a9ccd1a860 100644
--- a/chrome/browser/resources/shared/js/cr/ui/menu_item.js
+++ b/chrome/browser/resources/shared/js/cr/ui/menu_item.js
@@ -52,6 +52,7 @@ cr.define('cr.ui', function() {
this.command_.removeEventListener('labelChange', this);
this.command_.removeEventListener('disabledChange', this);
this.command_.removeEventListener('hiddenChange', this);
+ this.command_.removeEventListener('checkedChange', this);
}
if (typeof command == 'string' && command[0] == '#') {
@@ -71,6 +72,7 @@ cr.define('cr.ui', function() {
this.command_.addEventListener('labelChange', this);
this.command_.addEventListener('disabledChange', this);
this.command_.addEventListener('hiddenChange', this);
+ this.command_.addEventListener('checkedChange', this);
}
},
@@ -124,6 +126,9 @@ cr.define('cr.ui', function() {
case 'labelChange':
this.label = this.command.label;
break;
+ case 'checkedChange':
+ this.checked = this.command.checked;
+ break;
}
}
};
@@ -146,6 +151,12 @@ cr.define('cr.ui', function() {
*/
cr.defineProperty(MenuItem, 'selected', cr.PropertyKind.BOOL_ATTR);
+ /**
+ * Whether the menu item is checked or not.
+ * @type {boolean}
+ */
+ cr.defineProperty(MenuItem, 'checked', cr.PropertyKind.BOOL_ATTR);
+
// Export
return {
MenuItem: MenuItem
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/command.js ('k') | tools/grit/grit/format/html_inline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698