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

Unified Diff: ash/shelf/wm_shelf.cc

Issue 2894743002: Make launching apps from shelf more intuitive (Closed)
Patch Set: Replace root window with display id in app launch params. 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..331053bb6979a3c86aeb8af3019dace104c45e28 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) {
+ ActivateShelfItemOnDisplay(item_index, display::kInvalidDisplayId);
+}
+
+// static
+void WmShelf::ActivateShelfItemOnDisplay(int item_index, int64_t display_id) {
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