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 667d2f0c539ce26fb77acad8cb6176b70f950248..5b1ce65338d05bef1bbb0ee05db8631a7ad74026 100644 |
--- a/chrome/browser/resources/shared/js/cr/ui/menu_item.js |
+++ b/chrome/browser/resources/shared/js/cr/ui/menu_item.js |
@@ -39,6 +39,10 @@ cr.define('cr.ui', function() { |
// Adding the 'custom-appearance' class prevents widgets.css from changing |
// the appearance of this element. |
this.classList.add('custom-appearance'); |
+ |
+ var iconUrl; |
+ if ((iconUrl = this.getAttribute('icon'))) |
+ this.iconUrl = iconUrl; |
James Hawkins
2012/05/16 17:12:18
Why not:
this.iconUrl = this.getAttribute('icon')
Dmitry Zvorygin
2012/05/17 12:11:15
We don't want to set iconUrl to 'undefined'. Just
|
}, |
/** |
@@ -92,6 +96,17 @@ cr.define('cr.ui', function() { |
}, |
/** |
+ * Menu icon. |
+ * @type {string} |
+ */ |
+ get iconUrl() { |
+ return this.style.backgroundImage; |
+ }, |
+ set iconUrl(url) { |
+ this.style.backgroundImage = 'url(' + url + ')'; |
+ }, |
+ |
+ /** |
* @return {boolean} Whether the menu item is a separator. |
*/ |
isSeparator: function() { |