| Index: ui/base/models/simple_menu_model.cc
|
| diff --git a/ui/base/models/simple_menu_model.cc b/ui/base/models/simple_menu_model.cc
|
| index be8435688b43c7b4c30397192b455e766551a28a..3a38b0dd206c4e85c0bc9b495d63db9b7aa6bdb2 100644
|
| --- a/ui/base/models/simple_menu_model.cc
|
| +++ b/ui/base/models/simple_menu_model.cc
|
| @@ -6,8 +6,8 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/message_loop.h"
|
| -#include "third_party/skia/include/core/SkBitmap.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| +#include "ui/gfx/image/image_skia.h"
|
|
|
| namespace ui {
|
|
|
| @@ -16,7 +16,7 @@ const int kSeparatorId = -1;
|
| struct SimpleMenuModel::Item {
|
| int command_id;
|
| string16 label;
|
| - SkBitmap icon;
|
| + gfx::ImageSkia icon;
|
| ItemType type;
|
| int group_id;
|
| MenuModel* submenu;
|
| @@ -40,7 +40,7 @@ string16 SimpleMenuModel::Delegate::GetLabelForCommandId(int command_id) const {
|
| }
|
|
|
| bool SimpleMenuModel::Delegate::GetIconForCommandId(
|
| - int command_id, SkBitmap* bitmap) const {
|
| + int command_id, gfx::ImageSkia* image_skia) const {
|
| return false;
|
| }
|
|
|
| @@ -71,7 +71,8 @@ SimpleMenuModel::~SimpleMenuModel() {
|
| }
|
|
|
| void SimpleMenuModel::AddItem(int command_id, const string16& label) {
|
| - Item item = { command_id, label, SkBitmap(), TYPE_COMMAND, -1, NULL, NULL };
|
| + Item item = { command_id, label, gfx::ImageSkia(), TYPE_COMMAND, -1, NULL,
|
| + NULL };
|
| AppendItem(item);
|
| }
|
|
|
| @@ -80,13 +81,14 @@ void SimpleMenuModel::AddItemWithStringId(int command_id, int string_id) {
|
| }
|
|
|
| void SimpleMenuModel::AddSeparator() {
|
| - Item item = { kSeparatorId, string16(), SkBitmap(), TYPE_SEPARATOR, -1,
|
| + Item item = { kSeparatorId, string16(), gfx::ImageSkia(), TYPE_SEPARATOR, -1,
|
| NULL, NULL };
|
| AppendItem(item);
|
| }
|
|
|
| void SimpleMenuModel::AddCheckItem(int command_id, const string16& label) {
|
| - Item item = { command_id, label, SkBitmap(), TYPE_CHECK, -1, NULL, NULL };
|
| + Item item = { command_id, label, gfx::ImageSkia(), TYPE_CHECK, -1, NULL,
|
| + NULL };
|
| AppendItem(item);
|
| }
|
|
|
| @@ -96,7 +98,7 @@ void SimpleMenuModel::AddCheckItemWithStringId(int command_id, int string_id) {
|
|
|
| void SimpleMenuModel::AddRadioItem(int command_id, const string16& label,
|
| int group_id) {
|
| - Item item = { command_id, label, SkBitmap(), TYPE_RADIO, group_id, NULL,
|
| + Item item = { command_id, label, gfx::ImageSkia(), TYPE_RADIO, group_id, NULL,
|
| NULL };
|
| AppendItem(item);
|
| }
|
| @@ -108,14 +110,15 @@ void SimpleMenuModel::AddRadioItemWithStringId(int command_id, int string_id,
|
|
|
| void SimpleMenuModel::AddButtonItem(int command_id,
|
| ButtonMenuItemModel* model) {
|
| - Item item = { command_id, string16(), SkBitmap(), TYPE_BUTTON_ITEM, -1, NULL,
|
| - model };
|
| + Item item = { command_id, string16(), gfx::ImageSkia(), TYPE_BUTTON_ITEM, -1,
|
| + NULL, model };
|
| AppendItem(item);
|
| }
|
|
|
| void SimpleMenuModel::AddSubMenu(int command_id, const string16& label,
|
| MenuModel* model) {
|
| - Item item = { command_id, label, SkBitmap(), TYPE_SUBMENU, -1, model, NULL };
|
| + Item item = { command_id, label, gfx::ImageSkia(), TYPE_SUBMENU, -1, model,
|
| + NULL };
|
| AppendItem(item);
|
| }
|
|
|
| @@ -126,7 +129,8 @@ void SimpleMenuModel::AddSubMenuWithStringId(int command_id,
|
|
|
| void SimpleMenuModel::InsertItemAt(
|
| int index, int command_id, const string16& label) {
|
| - Item item = { command_id, label, SkBitmap(), TYPE_COMMAND, -1, NULL, NULL };
|
| + Item item = { command_id, label, gfx::ImageSkia(), TYPE_COMMAND, -1, NULL,
|
| + NULL };
|
| InsertItemAtIndex(item, index);
|
| }
|
|
|
| @@ -136,14 +140,15 @@ void SimpleMenuModel::InsertItemWithStringIdAt(
|
| }
|
|
|
| void SimpleMenuModel::InsertSeparatorAt(int index) {
|
| - Item item = { kSeparatorId, string16(), SkBitmap(), TYPE_SEPARATOR, -1,
|
| + Item item = { kSeparatorId, string16(), gfx::ImageSkia(), TYPE_SEPARATOR, -1,
|
| NULL, NULL };
|
| InsertItemAtIndex(item, index);
|
| }
|
|
|
| void SimpleMenuModel::InsertCheckItemAt(
|
| int index, int command_id, const string16& label) {
|
| - Item item = { command_id, label, SkBitmap(), TYPE_CHECK, -1, NULL, NULL };
|
| + Item item = { command_id, label, gfx::ImageSkia(), TYPE_CHECK, -1, NULL,
|
| + NULL };
|
| InsertItemAtIndex(item, index);
|
| }
|
|
|
| @@ -155,7 +160,7 @@ void SimpleMenuModel::InsertCheckItemWithStringIdAt(
|
|
|
| void SimpleMenuModel::InsertRadioItemAt(
|
| int index, int command_id, const string16& label, int group_id) {
|
| - Item item = { command_id, label, SkBitmap(), TYPE_RADIO, group_id, NULL,
|
| + Item item = { command_id, label, gfx::ImageSkia(), TYPE_RADIO, group_id, NULL,
|
| NULL };
|
| InsertItemAtIndex(item, index);
|
| }
|
| @@ -168,7 +173,8 @@ void SimpleMenuModel::InsertRadioItemWithStringIdAt(
|
|
|
| void SimpleMenuModel::InsertSubMenuAt(
|
| int index, int command_id, const string16& label, MenuModel* model) {
|
| - Item item = { command_id, label, SkBitmap(), TYPE_SUBMENU, -1, model, NULL };
|
| + Item item = { command_id, label, gfx::ImageSkia(), TYPE_SUBMENU, -1, model,
|
| + NULL };
|
| InsertItemAtIndex(item, index);
|
| }
|
|
|
| @@ -178,7 +184,7 @@ void SimpleMenuModel::InsertSubMenuWithStringIdAt(
|
| model);
|
| }
|
|
|
| -void SimpleMenuModel::SetIcon(int index, const SkBitmap& icon) {
|
| +void SimpleMenuModel::SetIcon(int index, const gfx::ImageSkia& icon) {
|
| items_[index].icon = icon;
|
| }
|
|
|
| @@ -253,7 +259,7 @@ int SimpleMenuModel::GetGroupIdAt(int index) const {
|
| return items_.at(FlipIndex(index)).group_id;
|
| }
|
|
|
| -bool SimpleMenuModel::GetIconAt(int index, SkBitmap* icon) {
|
| +bool SimpleMenuModel::GetIconAt(int index, gfx::ImageSkia* icon) {
|
| if (IsItemDynamicAt(index))
|
| return delegate_->GetIconForCommandId(GetCommandIdAt(index), icon);
|
|
|
|
|