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

Unified Diff: ash/common/shelf/wm_shelf.cc

Issue 2718563008: mash: Use mojo for ShelfItemDelegate and [app] MenuItem. (Closed)
Patch Set: Cleanup; fix ash_shell compile and a couple tests. Created 3 years, 9 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
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..ef3339764279aafe32e92022663040c620f228fa 100644
--- a/ash/common/shelf/wm_shelf.cc
+++ b/ash/common/shelf/wm_shelf.cc
@@ -27,6 +27,13 @@
namespace ash {
+namespace {
+
+// A callback that does nothing after shelf item selection handling.
+void NoopCallback(ShelfAction, ShelfItemDelegate::MenuItemList) {}
+
+} // namespace
+
// WmShelf::AutoHideEventHandler -----------------------------------------------
// Forwards mouse and gesture events to ShelfLayoutManager for auto-hide.
@@ -292,8 +299,10 @@ 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);
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698