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

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

Issue 2696073002: Merge ShelfItemDelegate::ItemSelected & LauncherItemDelegate::Activate. (Closed)
Patch Set: Cleanup Created 3 years, 10 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 cf9d61540512c022b926c1f13e2e557a38e20ccc..e1e68296308b5a70bb50bf50c688c15d55886f6c 100644
--- a/ash/common/shelf/wm_shelf.cc
+++ b/ash/common/shelf/wm_shelf.cc
@@ -23,6 +23,7 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "ui/aura/env.h"
+#include "ui/display/display.h"
#include "ui/gfx/geometry/rect.h"
namespace ash {
@@ -292,16 +293,12 @@ void WmShelf::LaunchShelfItem(int item_index) {
// static
void WmShelf::ActivateShelfItem(int item_index) {
- // We pass in a keyboard event which will then trigger a switch to the
- // next item if the current one is already active.
- ui::KeyEvent event(ui::ET_KEY_RELEASED,
- ui::VKEY_UNKNOWN, // The actual key gets ignored.
- ui::EF_NONE);
-
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(event);
+ int64_t display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id();
+ item_delegate->ItemSelected(ui::ET_KEY_RELEASED, ui::EF_NONE, display_id,
+ LAUNCH_FROM_UNKNOWN);
}
bool WmShelf::ProcessGestureEvent(const ui::GestureEvent& event) {

Powered by Google App Engine
This is Rietveld 408576698