| Index: ash/common/shelf/shelf_application_menu_model.cc
|
| diff --git a/ash/common/shelf/shelf_application_menu_model.cc b/ash/common/shelf/shelf_application_menu_model.cc
|
| index 7bf323c12a0339ab022042ad67fa87ca8154c64f..92904b6e14b1ea1c9d9434eb3964647a6be3ee1b 100644
|
| --- a/ash/common/shelf/shelf_application_menu_model.cc
|
| +++ b/ash/common/shelf/shelf_application_menu_model.cc
|
| @@ -9,9 +9,8 @@
|
| #include <limits>
|
| #include <utility>
|
|
|
| -#include "ash/common/shelf/shelf_item_delegate.h"
|
| -#include "ash/public/cpp/shelf_application_menu_item.h"
|
| #include "base/metrics/histogram_macros.h"
|
| +#include "ui/gfx/image/image.h"
|
|
|
| namespace {
|
|
|
| @@ -23,7 +22,7 @@ namespace ash {
|
|
|
| ShelfApplicationMenuModel::ShelfApplicationMenuModel(
|
| const base::string16& title,
|
| - ShelfAppMenuItemList items,
|
| + ShelfItemDelegate::MenuItemList items,
|
| ShelfItemDelegate* delegate)
|
| : ui::SimpleMenuModel(this), items_(std::move(items)), delegate_(delegate) {
|
| AddSeparator(ui::SPACING_SEPARATOR);
|
| @@ -31,10 +30,12 @@ ShelfApplicationMenuModel::ShelfApplicationMenuModel(
|
| AddSeparator(ui::SPACING_SEPARATOR);
|
|
|
| for (size_t i = 0; i < items_.size(); i++) {
|
| - ShelfApplicationMenuItem* item = items_[i].get();
|
| - AddItem(i, item->title());
|
| - if (!item->icon().IsEmpty())
|
| - SetIcon(GetIndexOfCommandId(i), item->icon());
|
| + mojom::MenuItem* item = items_[i].get();
|
| + AddItem(i, item->label);
|
| + if (!item->image.isNull()) {
|
| + SetIcon(GetIndexOfCommandId(i),
|
| + gfx::Image::CreateFrom1xBitmap(item->image));
|
| + }
|
| }
|
|
|
| // SimpleMenuModel does not allow two consecutive spacing separator items.
|
| @@ -58,7 +59,7 @@ void ShelfApplicationMenuModel::ExecuteCommand(int command_id,
|
| DCHECK(delegate_);
|
| DCHECK(IsCommandIdEnabled(command_id));
|
| // Have the delegate execute its own custom command id for the given item.
|
| - delegate_->ExecuteCommand(items_[command_id]->command_id(), event_flags);
|
| + delegate_->ExecuteCommand(items_[command_id]->command_id, event_flags);
|
| RecordMenuItemSelectedMetrics(command_id, items_.size());
|
| }
|
|
|
|
|