summaryrefslogtreecommitdiffstats
path: root/ui/views/controls/menu
diff options
context:
space:
mode:
Diffstat (limited to 'ui/views/controls/menu')
-rw-r--r--ui/views/controls/menu/menu.cc18
-rw-r--r--ui/views/controls/menu/menu.h21
-rw-r--r--ui/views/controls/menu/menu_config_views.cc6
-rw-r--r--ui/views/controls/menu/menu_image_util.cc23
-rw-r--r--ui/views/controls/menu/menu_image_util.h10
-rw-r--r--ui/views/controls/menu/menu_item_view.cc20
-rw-r--r--ui/views/controls/menu/menu_item_view.h18
-rw-r--r--ui/views/controls/menu/menu_item_view_views.cc5
-rw-r--r--ui/views/controls/menu/menu_model_adapter_unittest.cc2
-rw-r--r--ui/views/controls/menu/menu_win.cc12
-rw-r--r--ui/views/controls/menu/menu_win.h12
-rw-r--r--ui/views/controls/menu/native_menu_win.cc4
12 files changed, 77 insertions, 74 deletions
diff --git a/ui/views/controls/menu/menu.cc b/ui/views/controls/menu/menu.cc
index 2607cde..9b9a099 100644
--- a/ui/views/controls/menu/menu.cc
+++ b/ui/views/controls/menu/menu.cc
@@ -1,11 +1,11 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/views/controls/menu/menu.h"
#include "base/i18n/rtl.h"
-#include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/gfx/image/image_skia.h"
namespace views {
@@ -13,8 +13,8 @@ bool Menu::Delegate::IsRightToLeftUILayout() const {
return base::i18n::IsRTL();
}
-const SkBitmap& Menu::Delegate::GetEmptyIcon() const {
- static const SkBitmap* empty_icon = new SkBitmap();
+const gfx::ImageSkia& Menu::Delegate::GetEmptyIcon() const {
+ static const gfx::ImageSkia* empty_icon = new gfx::ImageSkia();
return *empty_icon;
}
@@ -44,7 +44,7 @@ void Menu::AddMenuItem(int index,
if (type == SEPARATOR)
AddSeparator(index);
else
- AddMenuItemInternal(index, item_id, label, SkBitmap(), type);
+ AddMenuItemInternal(index, item_id, label, gfx::ImageSkia(), type);
}
Menu* Menu::AppendSubMenu(int item_id, const string16& label) {
@@ -52,12 +52,12 @@ Menu* Menu::AppendSubMenu(int item_id, const string16& label) {
}
Menu* Menu::AddSubMenu(int index, int item_id, const string16& label) {
- return AddSubMenuWithIcon(index, item_id, label, SkBitmap());
+ return AddSubMenuWithIcon(index, item_id, label, gfx::ImageSkia());
}
Menu* Menu::AppendSubMenuWithIcon(int item_id,
const string16& label,
- const SkBitmap& icon) {
+ const gfx::ImageSkia& icon) {
return AddSubMenuWithIcon(-1, item_id, label, icon);
}
@@ -85,14 +85,14 @@ void Menu::AppendSeparator() {
void Menu::AppendMenuItemWithIcon(int item_id,
const string16& label,
- const SkBitmap& icon) {
+ const gfx::ImageSkia& icon) {
AddMenuItemWithIcon(-1, item_id, label, icon);
}
void Menu::AddMenuItemWithIcon(int index,
int item_id,
const string16& label,
- const SkBitmap& icon) {
+ const gfx::ImageSkia& icon) {
AddMenuItemInternal(index, item_id, label, icon, Menu::NORMAL);
}
diff --git a/ui/views/controls/menu/menu.h b/ui/views/controls/menu/menu.h
index 2ee90f9..2ec9d36 100644
--- a/ui/views/controls/menu/menu.h
+++ b/ui/views/controls/menu/menu.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -13,9 +13,8 @@
#include "ui/gfx/native_widget_types.h"
#include "ui/views/views_export.h"
-class SkBitmap;
-
namespace gfx {
+class ImageSkia;
class Point;
}
@@ -63,7 +62,7 @@ class VIEWS_EXPORT Menu {
}
// The icon shown for the menu item.
- virtual const SkBitmap& GetIcon(int id) const {
+ virtual const gfx::ImageSkia& GetIcon(int id) const {
return GetEmptyIcon();
}
@@ -124,7 +123,7 @@ class VIEWS_EXPORT Menu {
protected:
// Returns an empty icon.
- const SkBitmap& GetEmptyIcon() const;
+ const gfx::ImageSkia& GetEmptyIcon() const;
};
// How this popup should align itself relative to the point it is run at.
@@ -194,11 +193,11 @@ class VIEWS_EXPORT Menu {
// to draw the menu, instead of relying on Windows.
Menu* AppendSubMenuWithIcon(int item_id,
const string16& label,
- const SkBitmap& icon);
+ const gfx::ImageSkia& icon);
virtual Menu* AddSubMenuWithIcon(int index,
int item_id,
const string16& label,
- const SkBitmap& icon) = 0;
+ const gfx::ImageSkia& icon) = 0;
// This is a convenience for standard text label menu items where the label
// is provided with this call.
@@ -219,11 +218,11 @@ class VIEWS_EXPORT Menu {
// the menu, instead of relying on Windows.
void AppendMenuItemWithIcon(int item_id,
const string16& label,
- const SkBitmap& icon);
+ const gfx::ImageSkia& icon);
virtual void AddMenuItemWithIcon(int index,
int item_id,
const string16& label,
- const SkBitmap& icon);
+ const gfx::ImageSkia& icon);
// Enables or disables the item with the specified id.
virtual void EnableMenuItemByID(int item_id, bool enabled) = 0;
@@ -235,7 +234,7 @@ class VIEWS_EXPORT Menu {
// Sets an icon for an item with a given item_id. Calling this function
// also forces the Menu class to draw the menu, instead of relying on Windows.
// Returns false if the item with |item_id| is not found.
- virtual bool SetIcon(const SkBitmap& icon, int item_id) = 0;
+ virtual bool SetIcon(const gfx::ImageSkia& icon, int item_id) = 0;
// Shows the menu, blocks until the user dismisses the menu or selects an
// item, and executes the command for the selected item (if any).
@@ -259,7 +258,7 @@ class VIEWS_EXPORT Menu {
virtual void AddMenuItemInternal(int index,
int item_id,
const string16& label,
- const SkBitmap& icon,
+ const gfx::ImageSkia& icon,
MenuItemType type) = 0;
private:
diff --git a/ui/views/controls/menu/menu_config_views.cc b/ui/views/controls/menu/menu_config_views.cc
index bfb0464..c690ebd 100644
--- a/ui/views/controls/menu/menu_config_views.cc
+++ b/ui/views/controls/menu/menu_config_views.cc
@@ -5,10 +5,10 @@
#include "ui/views/controls/menu/menu_config.h"
#include "grit/ui_resources.h"
-#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/layout.h"
#include "ui/gfx/image/image.h"
+#include "ui/gfx/image/image_skia.h"
#include "ui/base/native_theme/native_theme_aura.h"
namespace views {
@@ -25,8 +25,8 @@ MenuConfig* MenuConfig::Create() {
config->item_left_margin = 8;
config->arrow_to_edge_padding = 20;
config->icon_to_label_padding = 4;
- config->arrow_width = rb.GetImageNamed(IDR_MENU_ARROW).ToSkBitmap()->width();
- const SkBitmap* check = rb.GetImageNamed(IDR_MENU_CHECK).ToSkBitmap();
+ config->arrow_width = rb.GetImageNamed(IDR_MENU_ARROW).ToImageSkia()->width();
+ const gfx::ImageSkia* check = rb.GetImageNamed(IDR_MENU_CHECK).ToImageSkia();
// Add 4 to force some padding between check and label.
config->check_width = check->width() + 4;
config->check_height = check->height();
diff --git a/ui/views/controls/menu/menu_image_util.cc b/ui/views/controls/menu/menu_image_util.cc
index bd58755..d5a8be2 100644
--- a/ui/views/controls/menu/menu_image_util.cc
+++ b/ui/views/controls/menu/menu_image_util.cc
@@ -10,6 +10,7 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image.h"
+#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/point.h"
#include "ui/gfx/size.h"
@@ -29,7 +30,7 @@ const SkColor kRadioButtonIndicatorGradient0 = SkColorSetRGB(0, 0, 0);
const SkColor kRadioButtonIndicatorGradient1 = SkColorSetRGB(0x83, 0x83, 0x83);
const SkColor kIndicatorStroke = SkColorSetRGB(0, 0, 0);
-SkBitmap* CreateRadioButtonImage(bool selected) {
+gfx::ImageSkia* CreateRadioButtonImage(bool selected) {
// + 2 (1px on each side) to cover rounding error.
gfx::Canvas canvas(gfx::Size(kIndicatorSize + 2, kIndicatorSize + 2), false);
canvas.Translate(gfx::Point(1, 1));
@@ -78,18 +79,18 @@ SkBitmap* CreateRadioButtonImage(bool selected) {
canvas.sk_canvas()->drawCircle(radius, radius,
kSelectedIndicatorSize / 2, paint);
}
- return new SkBitmap(canvas.ExtractBitmap());
+ return new gfx::ImageSkia(canvas.ExtractBitmap());
}
-SkBitmap* GetRtlSubmenuArrowImage() {
- static SkBitmap* kRtlArrow = NULL;
+gfx::ImageSkia* GetRtlSubmenuArrowImage() {
+ static gfx::ImageSkia* kRtlArrow = NULL;
if (!kRtlArrow) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- const SkBitmap* r = rb.GetImageNamed(IDR_MENU_ARROW).ToSkBitmap();
+ const gfx::ImageSkia* r = rb.GetImageNamed(IDR_MENU_ARROW).ToImageSkia();
gfx::Canvas canvas(gfx::Size(r->width(), r->height()), false);
canvas.Scale(-1, 1);
canvas.DrawBitmapInt(*r, - r->width(), 0);
- kRtlArrow = new SkBitmap(canvas.ExtractBitmap());
+ kRtlArrow = new gfx::ImageSkia(canvas.ExtractBitmap());
}
return kRtlArrow;
}
@@ -98,17 +99,17 @@ SkBitmap* GetRtlSubmenuArrowImage() {
namespace views {
-const SkBitmap* GetRadioButtonImage(bool selected) {
- static const SkBitmap* kRadioOn = CreateRadioButtonImage(true);
- static const SkBitmap* kRadioOff = CreateRadioButtonImage(false);
+const gfx::ImageSkia* GetRadioButtonImage(bool selected) {
+ static const gfx::ImageSkia* kRadioOn = CreateRadioButtonImage(true);
+ static const gfx::ImageSkia* kRadioOff = CreateRadioButtonImage(false);
return selected ? kRadioOn : kRadioOff;
}
-const SkBitmap* GetSubmenuArrowImage() {
+const gfx::ImageSkia* GetSubmenuArrowImage() {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
return base::i18n::IsRTL() ? GetRtlSubmenuArrowImage()
- : rb.GetImageNamed(IDR_MENU_ARROW).ToSkBitmap();
+ : rb.GetImageNamed(IDR_MENU_ARROW).ToImageSkia();
}
} // namespace views
diff --git a/ui/views/controls/menu/menu_image_util.h b/ui/views/controls/menu/menu_image_util.h
index 7d98035..5e1062c 100644
--- a/ui/views/controls/menu/menu_image_util.h
+++ b/ui/views/controls/menu/menu_image_util.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,7 +6,9 @@
#define UI_VIEWS_CONTROLS_MENU_MENU_IMAGE_UTIL_H_
#pragma once
-#include "third_party/skia/include/core/SkBitmap.h"
+namespace gfx {
+class ImageSkia;
+}
namespace views {
@@ -14,10 +16,10 @@ namespace views {
// It returns the "selected" image when |selected| is
// true, or the "unselected" image if false.
// The returned image is global object and should not be freed.
-const SkBitmap* GetRadioButtonImage(bool selected);
+const gfx::ImageSkia* GetRadioButtonImage(bool selected);
// Returns the image for submenu arrow for current RTL setting.
-const SkBitmap* GetSubmenuArrowImage();
+const gfx::ImageSkia* GetSubmenuArrowImage();
} // namespace views
diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc
index fff309b..b5f8111 100644
--- a/ui/views/controls/menu/menu_item_view.cc
+++ b/ui/views/controls/menu/menu_item_view.cc
@@ -203,7 +203,7 @@ void MenuItemView::Cancel() {
MenuItemView* MenuItemView::AddMenuItemAt(int index,
int item_id,
const string16& label,
- const SkBitmap& icon,
+ const gfx::ImageSkia& icon,
Type type) {
DCHECK_NE(type, EMPTY);
DCHECK_LE(0, index);
@@ -244,17 +244,17 @@ void MenuItemView::RemoveMenuItemAt(int index) {
MenuItemView* MenuItemView::AppendMenuItem(int item_id,
const string16& label,
Type type) {
- return AppendMenuItemImpl(item_id, label, SkBitmap(), type);
+ return AppendMenuItemImpl(item_id, label, gfx::ImageSkia(), type);
}
MenuItemView* MenuItemView::AppendSubMenu(int item_id,
const string16& label) {
- return AppendMenuItemImpl(item_id, label, SkBitmap(), SUBMENU);
+ return AppendMenuItemImpl(item_id, label, gfx::ImageSkia(), SUBMENU);
}
MenuItemView* MenuItemView::AppendSubMenuWithIcon(int item_id,
const string16& label,
- const SkBitmap& icon) {
+ const gfx::ImageSkia& icon) {
return AppendMenuItemImpl(item_id, label, icon, SUBMENU);
}
@@ -268,19 +268,19 @@ MenuItemView* MenuItemView::AppendDelegateMenuItem(int item_id) {
}
void MenuItemView::AppendSeparator() {
- AppendMenuItemImpl(0, string16(), SkBitmap(), SEPARATOR);
+ AppendMenuItemImpl(0, string16(), gfx::ImageSkia(), SEPARATOR);
}
MenuItemView* MenuItemView::AppendMenuItemWithIcon(int item_id,
const string16& label,
- const SkBitmap& icon) {
+ const gfx::ImageSkia& icon) {
return AppendMenuItemImpl(item_id, label, icon, NORMAL);
}
MenuItemView* MenuItemView::AppendMenuItemFromModel(ui::MenuModel* model,
int index,
int id) {
- SkBitmap icon;
+ gfx::ImageSkia icon;
string16 label;
MenuItemView::Type type;
ui::MenuModel::ItemType menu_type = model->GetTypeAt(index);
@@ -317,7 +317,7 @@ MenuItemView* MenuItemView::AppendMenuItemFromModel(ui::MenuModel* model,
MenuItemView* MenuItemView::AppendMenuItemImpl(int item_id,
const string16& label,
- const SkBitmap& icon,
+ const gfx::ImageSkia& icon,
Type type) {
const int index = submenu_ ? submenu_->child_count() : 0;
return AddMenuItemAt(index, item_id, label, icon, type);
@@ -353,13 +353,13 @@ void MenuItemView::SetTooltip(const string16& tooltip, int item_id) {
item->tooltip_ = tooltip;
}
-void MenuItemView::SetIcon(const SkBitmap& icon, int item_id) {
+void MenuItemView::SetIcon(const gfx::ImageSkia& icon, int item_id) {
MenuItemView* item = GetMenuItemByID(item_id);
DCHECK(item);
item->SetIcon(icon);
}
-void MenuItemView::SetIcon(const SkBitmap& icon) {
+void MenuItemView::SetIcon(const gfx::ImageSkia& icon) {
icon_ = icon;
SchedulePaint();
}
diff --git a/ui/views/controls/menu/menu_item_view.h b/ui/views/controls/menu/menu_item_view.h
index 928ea84..6f4b89a 100644
--- a/ui/views/controls/menu/menu_item_view.h
+++ b/ui/views/controls/menu/menu_item_view.h
@@ -13,7 +13,7 @@
#include "base/logging.h"
#include "base/string16.h"
#include "build/build_config.h"
-#include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/gfx/image/image_skia.h"
#include "ui/views/view.h"
#if defined(OS_WIN)
@@ -134,7 +134,7 @@ class VIEWS_EXPORT MenuItemView : public View {
MenuItemView* AddMenuItemAt(int index,
int item_id,
const string16& label,
- const SkBitmap& icon,
+ const gfx::ImageSkia& icon,
Type type);
// Remove an item from the menu at a specified index.
@@ -163,7 +163,7 @@ class VIEWS_EXPORT MenuItemView : public View {
// The returned pointer is owned by this menu.
MenuItemView* AppendSubMenuWithIcon(int item_id,
const string16& label,
- const SkBitmap& icon);
+ const gfx::ImageSkia& icon);
// This is a convenience for standard text label menu items where the label
// is provided with this call.
@@ -182,7 +182,7 @@ class VIEWS_EXPORT MenuItemView : public View {
// the menu, instead of relying on Windows.
MenuItemView* AppendMenuItemWithIcon(int item_id,
const string16& label,
- const SkBitmap& icon);
+ const gfx::ImageSkia& icon);
// Creates a menu item for the specified entry in the model and appends it as
// a child. |index| should be offset by GetFirstItemIndex() before calling
@@ -194,7 +194,7 @@ class VIEWS_EXPORT MenuItemView : public View {
// All the AppendXXX methods funnel into this.
MenuItemView* AppendMenuItemImpl(int item_id,
const string16& label,
- const SkBitmap& icon,
+ const gfx::ImageSkia& icon,
Type type);
// Returns the view that contains child menu items. If the submenu has
@@ -234,13 +234,13 @@ class VIEWS_EXPORT MenuItemView : public View {
void SetTooltip(const string16& tooltip, int item_id);
// Sets the icon for the descendant identified by item_id.
- void SetIcon(const SkBitmap& icon, int item_id);
+ void SetIcon(const gfx::ImageSkia& icon, int item_id);
// Sets the icon of this menu item.
- void SetIcon(const SkBitmap& icon);
+ void SetIcon(const gfx::ImageSkia& icon);
// Returns the icon.
- const SkBitmap& GetIcon() const { return icon_; }
+ const gfx::ImageSkia& GetIcon() const { return icon_; }
// Sets the command id of this menu item.
void SetCommand(int command) { command_ = command; }
@@ -436,7 +436,7 @@ class VIEWS_EXPORT MenuItemView : public View {
string16 title_;
// Icon.
- SkBitmap icon_;
+ gfx::ImageSkia icon_;
// Does the title have a mnemonic? Only useful on the root menu item.
bool has_mnemonics_;
diff --git a/ui/views/controls/menu/menu_item_view_views.cc b/ui/views/controls/menu/menu_item_view_views.cc
index 00beeb9..e859546 100644
--- a/ui/views/controls/menu/menu_item_view_views.cc
+++ b/ui/views/controls/menu/menu_item_view_views.cc
@@ -45,13 +45,14 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
// Render the check.
if (type_ == CHECKBOX && GetDelegate()->IsItemChecked(GetCommand())) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- const SkBitmap* check = rb.GetImageNamed(IDR_MENU_CHECK).ToSkBitmap();
+ const gfx::ImageSkia* check = rb.GetImageNamed(
+ IDR_MENU_CHECK).ToImageSkia();
// Don't use config.check_width here as it's padded to force more padding.
gfx::Rect check_bounds(icon_x, icon_y, check->width(), icon_height);
AdjustBoundsForRTLUI(&check_bounds);
canvas->DrawBitmapInt(*check, check_bounds.x(), check_bounds.y());
} else if (type_ == RADIO) {
- const SkBitmap* image =
+ const gfx::ImageSkia* image =
GetRadioButtonImage(GetDelegate()->IsItemChecked(GetCommand()));
gfx::Rect radio_bounds(icon_x,
top_margin +
diff --git a/ui/views/controls/menu/menu_model_adapter_unittest.cc b/ui/views/controls/menu/menu_model_adapter_unittest.cc
index ba6d406..8f86335 100644
--- a/ui/views/controls/menu/menu_model_adapter_unittest.cc
+++ b/ui/views/controls/menu/menu_model_adapter_unittest.cc
@@ -79,7 +79,7 @@ class MenuModelBase : public ui::MenuModel {
return 0;
}
- virtual bool GetIconAt(int index, SkBitmap* icon) OVERRIDE {
+ virtual bool GetIconAt(int index, gfx::ImageSkia* icon) OVERRIDE {
return false;
}
diff --git a/ui/views/controls/menu/menu_win.cc b/ui/views/controls/menu/menu_win.cc
index 564fd5c..736a7ed 100644
--- a/ui/views/controls/menu/menu_win.cc
+++ b/ui/views/controls/menu/menu_win.cc
@@ -40,7 +40,7 @@ static MenuHostWindow* active_host_window = NULL;
// The data of menu items needed to display.
struct MenuWin::ItemData {
string16 label;
- SkBitmap icon;
+ gfx::ImageSkia icon;
bool submenu;
};
@@ -263,7 +263,7 @@ MenuWin::~MenuWin() {
void MenuWin::AddMenuItemWithIcon(int index,
int item_id,
const string16& label,
- const SkBitmap& icon) {
+ const gfx::ImageSkia& icon) {
owner_draw_ = true;
Menu::AddMenuItemWithIcon(index, item_id, label, icon);
}
@@ -271,7 +271,7 @@ void MenuWin::AddMenuItemWithIcon(int index,
Menu* MenuWin::AddSubMenuWithIcon(int index,
int item_id,
const string16& label,
- const SkBitmap& icon) {
+ const gfx::ImageSkia& icon) {
MenuWin* submenu = new MenuWin(this);
submenus_.push_back(submenu);
AddMenuItemInternal(index, item_id, label, icon, submenu->menu_, NORMAL);
@@ -305,7 +305,7 @@ void MenuWin::SetMenuLabel(int item_id, const string16& label) {
SetMenuItemInfo(menu_, item_id, false, &mii);
}
-bool MenuWin::SetIcon(const SkBitmap& icon, int item_id) {
+bool MenuWin::SetIcon(const gfx::ImageSkia& icon, int item_id) {
if (!owner_draw_)
owner_draw_ = true;
@@ -386,7 +386,7 @@ int MenuWin::ItemCount() {
void MenuWin::AddMenuItemInternal(int index,
int item_id,
const string16& label,
- const SkBitmap& icon,
+ const gfx::ImageSkia& icon,
MenuItemType type) {
AddMenuItemInternal(index, item_id, label, icon, NULL, type);
}
@@ -394,7 +394,7 @@ void MenuWin::AddMenuItemInternal(int index,
void MenuWin::AddMenuItemInternal(int index,
int item_id,
const string16& label,
- const SkBitmap& icon,
+ const gfx::ImageSkia& icon,
HMENU submenu,
MenuItemType type) {
DCHECK(type != SEPARATOR) << "Call AddSeparator instead!";
diff --git a/ui/views/controls/menu/menu_win.h b/ui/views/controls/menu/menu_win.h
index 3b20f27..dd12a64 100644
--- a/ui/views/controls/menu/menu_win.h
+++ b/ui/views/controls/menu/menu_win.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -50,16 +50,16 @@ class MenuWin : public Menu {
virtual void AddMenuItemWithIcon(int index,
int item_id,
const string16& label,
- const SkBitmap& icon) OVERRIDE;
+ const gfx::ImageSkia& icon) OVERRIDE;
virtual Menu* AddSubMenuWithIcon(int index,
int item_id,
const string16& label,
- const SkBitmap& icon) OVERRIDE;
+ const gfx::ImageSkia& icon) OVERRIDE;
virtual void AddSeparator(int index) OVERRIDE;
virtual void EnableMenuItemByID(int item_id, bool enabled) OVERRIDE;
virtual void EnableMenuItemAt(int index, bool enabled) OVERRIDE;
virtual void SetMenuLabel(int item_id, const string16& label) OVERRIDE;
- virtual bool SetIcon(const SkBitmap& icon, int item_id) OVERRIDE;
+ virtual bool SetIcon(const gfx::ImageSkia& icon, int item_id) OVERRIDE;
virtual void RunMenuAt(int x, int y) OVERRIDE;
virtual void Cancel() OVERRIDE;
virtual int ItemCount() OVERRIDE;
@@ -75,7 +75,7 @@ class MenuWin : public Menu {
virtual void AddMenuItemInternal(int index,
int item_id,
const string16& label,
- const SkBitmap& icon,
+ const gfx::ImageSkia& icon,
MenuItemType type) OVERRIDE;
private:
@@ -87,7 +87,7 @@ class MenuWin : public Menu {
void AddMenuItemInternal(int index,
int item_id,
const string16& label,
- const SkBitmap& icon,
+ const gfx::ImageSkia& icon,
HMENU submenu,
MenuItemType type);
diff --git a/ui/views/controls/menu/native_menu_win.cc b/ui/views/controls/menu/native_menu_win.cc
index 2b4af01..94461f33 100644
--- a/ui/views/controls/menu/native_menu_win.cc
+++ b/ui/views/controls/menu/native_menu_win.cc
@@ -12,7 +12,7 @@
#include "base/stl_util.h"
#include "base/string_util.h"
#include "base/win/wrapped_window_proc.h"
-#include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/gfx/image/image_skia.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/base/l10n/l10n_util.h"
@@ -252,7 +252,7 @@ class NativeMenuWin::MenuHostWindow {
// Draw the icon after the label, otherwise it would be covered
// by the label.
- SkBitmap icon;
+ gfx::ImageSkia icon;
if (data->native_menu_win->model_->GetIconAt(data->model_index, &icon)) {
// We currently don't support items with both icons and checkboxes.
DCHECK(type != ui::MenuModel::TYPE_CHECK);