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

Side by Side Diff: chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc

Issue 2763893004: arc: Fix regression in handling ARC shelf item. (Closed)
Patch Set: comments updated Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller .h" 5 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller .h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" 10 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 if (task_ids_.empty()) { 48 if (task_ids_.empty()) {
49 NOTREACHED(); 49 NOTREACHED();
50 callback.Run(ash::SHELF_ACTION_NONE, base::nullopt); 50 callback.Run(ash::SHELF_ACTION_NONE, base::nullopt);
51 return; 51 return;
52 } 52 }
53 arc::SetTaskActive(*task_ids_.begin()); 53 arc::SetTaskActive(*task_ids_.begin());
54 callback.Run(ash::SHELF_ACTION_NEW_WINDOW_CREATED, base::nullopt); 54 callback.Run(ash::SHELF_ACTION_NEW_WINDOW_CREATED, base::nullopt);
55 } 55 }
56 56
57 void ArcAppWindowLauncherItemController::ExecuteCommand(uint32_t command_id,
58 int32_t event_flags) {
59 ActivateIndexedApp(command_id);
60 }
61
57 MenuItemList ArcAppWindowLauncherItemController::GetAppMenuItems( 62 MenuItemList ArcAppWindowLauncherItemController::GetAppMenuItems(
58 int event_flags) { 63 int event_flags) {
59 MenuItemList items; 64 MenuItemList items;
60 base::string16 app_title = LauncherControllerHelper::GetAppTitle( 65 base::string16 app_title = LauncherControllerHelper::GetAppTitle(
61 launcher_controller()->profile(), app_id()); 66 launcher_controller()->profile(), app_id());
62 for (auto it = windows().begin(); it != windows().end(); ++it) { 67 for (auto it = windows().begin(); it != windows().end(); ++it) {
63 // TODO(khmel): resolve correct icon here. 68 // TODO(khmel): resolve correct icon here.
64 size_t i = std::distance(windows().begin(), it); 69 size_t i = std::distance(windows().begin(), it);
65 aura::Window* window = (*it)->GetNativeWindow(); 70 aura::Window* window = (*it)->GetNativeWindow();
66 ash::mojom::MenuItemPtr item = ash::mojom::MenuItem::New(); 71 ash::mojom::MenuItemPtr item = ash::mojom::MenuItem::New();
67 item->command_id = base::checked_cast<uint32_t>(i); 72 item->command_id = base::checked_cast<uint32_t>(i);
68 item->label = (window && !window->GetTitle().empty()) ? window->GetTitle() 73 item->label = (window && !window->GetTitle().empty()) ? window->GetTitle()
69 : app_title; 74 : app_title;
70 items.push_back(std::move(item)); 75 items.push_back(std::move(item));
71 } 76 }
72 return items; 77 return items;
73 } 78 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698