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

Unified Diff: chrome/browser/cocoa/menu_controller.mm

Issue 2856042: [Mac] Implement the update available notification in the wrench menu. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Observe notification Created 10 years, 5 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/cocoa/browser_window_cocoa.mm ('k') | chrome/browser/cocoa/restart_browser.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/menu_controller.mm
diff --git a/chrome/browser/cocoa/menu_controller.mm b/chrome/browser/cocoa/menu_controller.mm
index 047c8dd5b02f6adbe76038661da4f09d3b3d30dc..5315944e63910a3160e6202f24c7f7ee25dbae40 100644
--- a/chrome/browser/cocoa/menu_controller.mm
+++ b/chrome/browser/cocoa/menu_controller.mm
@@ -9,6 +9,7 @@
#include "app/menus/simple_menu_model.h"
#include "base/logging.h"
#include "base/sys_string_conversions.h"
+#include "skia/ext/skia_utils_mac.h"
@interface MenuController (Private)
- (NSMenu*)menuFromModel:(menus::MenuModel*)model;
@@ -86,6 +87,16 @@
[[NSMenuItem alloc] initWithTitle:label
action:@selector(itemSelected:)
keyEquivalent:@""]);
+
+ // If the menu item has an icon, set it.
+ SkBitmap skiaIcon;
+ if (model->GetIconAt(modelIndex, &skiaIcon) && !skiaIcon.isNull()) {
+ NSImage* icon = gfx::SkBitmapToNSImage(skiaIcon);
+ if (icon) {
+ [item setImage:icon];
+ }
+ }
+
menus::MenuModel::ItemType type = model->GetTypeAt(modelIndex);
if (type == menus::MenuModel::TYPE_SUBMENU) {
// Recursively build a submenu from the sub-model at this index.
« no previous file with comments | « chrome/browser/cocoa/browser_window_cocoa.mm ('k') | chrome/browser/cocoa/restart_browser.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698