Chromium Code Reviews| Index: ash/common/shelf/wm_shelf.cc |
| diff --git a/ash/common/shelf/wm_shelf.cc b/ash/common/shelf/wm_shelf.cc |
| index 2a06cc21baa5039b55009c07e6ae45d745dd18c5..472c6a8ef5a8d98b35b757884afdbaf3e0e217c3 100644 |
| --- a/ash/common/shelf/wm_shelf.cc |
| +++ b/ash/common/shelf/wm_shelf.cc |
| @@ -6,7 +6,6 @@ |
| #include "ash/common/shelf/shelf_controller.h" |
| #include "ash/common/shelf/shelf_delegate.h" |
| -#include "ash/common/shelf/shelf_item_delegate.h" |
| #include "ash/common/shelf/shelf_layout_manager.h" |
| #include "ash/common/shelf/shelf_locking_manager.h" |
| #include "ash/common/shelf/shelf_model.h" |
| @@ -16,6 +15,7 @@ |
| #include "ash/common/wm_shell.h" |
| #include "ash/common/wm_window.h" |
| #include "ash/public/cpp/shell_window_ids.h" |
| +#include "ash/public/interfaces/shelf.mojom.h" |
| #include "ash/root_window_controller.h" |
| #include "ash/shelf/shelf_bezel_event_handler.h" |
| #include "ash/shell.h" |
| @@ -27,6 +27,13 @@ |
| namespace ash { |
| +namespace { |
| + |
| +// A callback that does nothing after shelf item selection handling. |
| +void NoopCallback(ShelfAction, std::vector<mojom::MenuItemPtr>) {} |
|
James Cook
2017/03/10 16:56:01
btw, I like how you leave out the argument names o
msw
2017/03/10 20:44:45
Acknowledged.
|
| + |
| +} // namespace |
| + |
| // WmShelf::AutoHideEventHandler ----------------------------------------------- |
| // Forwards mouse and gesture events to ShelfLayoutManager for auto-hide. |
| @@ -291,9 +298,12 @@ void WmShelf::LaunchShelfItem(int item_index) { |
| void WmShelf::ActivateShelfItem(int item_index) { |
| ShelfModel* shelf_model = WmShell::Get()->shelf_model(); |
| const ShelfItem& item = shelf_model->items()[item_index]; |
| - ShelfItemDelegate* item_delegate = shelf_model->GetShelfItemDelegate(item.id); |
| - item_delegate->ItemSelected(ui::ET_KEY_RELEASED, ui::EF_NONE, |
| - display::kInvalidDisplayId, LAUNCH_FROM_UNKNOWN); |
| + mojom::ShelfItemDelegate* item_delegate = |
| + shelf_model->GetShelfItemDelegate(item.id); |
| + std::unique_ptr<ui::Event> event = base::MakeUnique<ui::KeyEvent>( |
| + ui::ET_KEY_RELEASED, ui::VKEY_UNKNOWN, ui::EF_NONE); |
| + item_delegate->ItemSelected(std::move(event), display::kInvalidDisplayId, |
| + LAUNCH_FROM_UNKNOWN, base::Bind(&NoopCallback)); |
| } |
| bool WmShelf::ProcessGestureEvent(const ui::GestureEvent& event) { |