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

Unified Diff: ash/shelf/wm_shelf.cc

Issue 2894743002: Make launching apps from shelf more intuitive (Closed)
Patch Set: This patch set has many platform related issue Created 3 years, 7 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/shelf/wm_shelf.cc
diff --git a/ash/shelf/wm_shelf.cc b/ash/shelf/wm_shelf.cc
index 57719054ccb4191d657e400ecd254f244f916ff9..6c6ea982ca534afaa3d7991c6259d83b09881263 100644
--- a/ash/shelf/wm_shelf.cc
+++ b/ash/shelf/wm_shelf.cc
@@ -295,13 +295,18 @@ void WmShelf::LaunchShelfItem(int item_index) {
// static
void WmShelf::ActivateShelfItem(int item_index) {
+ ActivateShelfItemInDisplay(item_index, display::kInvalidDisplayId);
+}
+
+// static
+void WmShelf::ActivateShelfItemInDisplay(int item_index, int64_t display_id) {
Mr4D (OOO till 08-26) 2017/05/22 15:02:28 Maybe .. onDisplay which sounds much better here.
weidongg 2017/05/23 16:37:46 Done.
ShelfModel* shelf_model = Shell::Get()->shelf_model();
const ShelfItem& item = shelf_model->items()[item_index];
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));
+ item_delegate->ItemSelected(std::move(event), display_id, LAUNCH_FROM_UNKNOWN,
+ base::Bind(&NoopCallback));
}
bool WmShelf::ProcessGestureEvent(const ui::GestureEvent& event) {

Powered by Google App Engine
This is Rietveld 408576698