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

Unified Diff: chrome/browser/ui/toolbar/wrench_menu_model.cc

Issue 10824402: Convert ui::MenuModel to use gfx::Image instead of ImageSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another day, another rebase Created 8 years, 4 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/ui/toolbar/wrench_menu_model.h ('k') | chrome/browser/ui/views/menu_model_adapter_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/toolbar/wrench_menu_model.cc
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc
index 2ae71b9b8bf4b9123a8b4771c34f563648727fa8..ef015d012682a137f770b700843256c4eb4dd0da 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc
@@ -299,14 +299,14 @@ string16 WrenchMenuModel::GetLabelForCommandId(int command_id) const {
}
bool WrenchMenuModel::GetIconForCommandId(int command_id,
- gfx::ImageSkia* icon) const {
+ gfx::Image* icon) const {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
switch (command_id) {
case IDC_UPGRADE_DIALOG: {
if (UpgradeDetector::GetInstance()->notify_upgrade()) {
- *icon = *rb.GetNativeImageNamed(
+ *icon = rb.GetNativeImageNamed(
UpgradeDetector::GetInstance()->GetIconResourceID(
- UpgradeDetector::UPGRADE_ICON_TYPE_MENU_ICON)).ToImageSkia();
+ UpgradeDetector::UPGRADE_ICON_TYPE_MENU_ICON));
return true;
}
return false;
@@ -319,7 +319,7 @@ bool WrenchMenuModel::GetIconForCommandId(int command_id,
if (error && error->HasCustomizedSyncMenuItem()) {
int icon_id = error->MenuItemIconResourceID();
if (icon_id) {
- *icon = *rb.GetNativeImageNamed(icon_id).ToImageSkia();
+ *icon = rb.GetNativeImageNamed(icon_id);
return true;
}
}
@@ -523,8 +523,8 @@ void WrenchMenuModel::Build() {
#if defined(OS_WIN)
SetIcon(GetIndexOfCommandId(IDC_VIEW_INCOMPATIBILITIES),
- *ui::ResourceBundle::GetSharedInstance().
- GetImageSkiaNamed(IDR_CONFLICT_MENU));
+ ui::ResourceBundle::GetSharedInstance().
+ GetNativeImageNamed(IDR_CONFLICT_MENU));
#endif
if (!is_touch_menu) {
@@ -533,7 +533,7 @@ void WrenchMenuModel::Build() {
if (browser_defaults::kShowHelpMenuItemIcon) {
ui::ResourceBundle& rb = ResourceBundle::GetSharedInstance();
SetIcon(GetIndexOfCommandId(IDC_HELP_PAGE_VIA_MENU),
- *rb.GetImageSkiaNamed(IDR_HELP_MENU));
+ rb.GetNativeImageNamed(IDR_HELP_MENU));
}
}
@@ -573,9 +573,9 @@ void WrenchMenuModel::AddGlobalErrorMenuItems() {
AddItem(error->MenuItemCommandID(), error->MenuItemLabel());
int icon_id = error->MenuItemIconResourceID();
if (icon_id) {
- gfx::Image& image = rb.GetImageNamed(icon_id);
+ const gfx::Image& image = rb.GetNativeImageNamed(icon_id);
SetIcon(GetIndexOfCommandId(error->MenuItemCommandID()),
- *image.ToImageSkia());
+ image);
}
}
}
« no previous file with comments | « chrome/browser/ui/toolbar/wrench_menu_model.h ('k') | chrome/browser/ui/views/menu_model_adapter_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698