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

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

Issue 2696073002: Merge ShelfItemDelegate::ItemSelected & LauncherItemDelegate::Activate. (Closed)
Patch Set: nit 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
« no previous file with comments | « ash/common/shelf/shelf_window_watcher_item_delegate.cc ('k') | ash/common/test/test_shelf_item_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..27d46f1a35a483f3756a5e64c6c3facfe63ba569 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/types/display_constants.h"
#include "ui/gfx/geometry/rect.h"
namespace ash {
@@ -292,16 +293,11 @@ 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);
+ item_delegate->ItemSelected(ui::ET_KEY_RELEASED, ui::EF_NONE,
+ display::kInvalidDisplayId, LAUNCH_FROM_UNKNOWN);
}
bool WmShelf::ProcessGestureEvent(const ui::GestureEvent& event) {
« no previous file with comments | « ash/common/shelf/shelf_window_watcher_item_delegate.cc ('k') | ash/common/test/test_shelf_item_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698