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

Unified Diff: ash/shelf/shelf.cc

Issue 2894743002: Make launching apps from shelf more intuitive (Closed)
Patch Set: Affected by new revision, gclient sync and re-upload. 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
« no previous file with comments | « ash/shelf/shelf.h ('k') | chrome/browser/ui/app_list/app_list_controller_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf.cc
diff --git a/ash/shelf/shelf.cc b/ash/shelf/shelf.cc
index 90d4912b2d6805f76d45a680b6ce71325c177565..4209ba0d6bb0cc46461928e1de6980e22c55fd24 100644
--- a/ash/shelf/shelf.cc
+++ b/ash/shelf/shelf.cc
@@ -274,13 +274,18 @@ void Shelf::LaunchShelfItem(int item_index) {
// static
void Shelf::ActivateShelfItem(int item_index) {
+ ActivateShelfItemOnDisplay(item_index, display::kInvalidDisplayId);
+}
+
+// static
+void Shelf::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 Shelf::ProcessGestureEvent(const ui::GestureEvent& event) {
« no previous file with comments | « ash/shelf/shelf.h ('k') | chrome/browser/ui/app_list/app_list_controller_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698