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

Unified Diff: chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc

Issue 2718563008: mash: Use mojo for ShelfItemDelegate and [app] MenuItem. (Closed)
Patch Set: Address comments. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc
index e84941fc5cd74ee6f00ee54bf130b7e18820d8ec..06e59e5bfc010bc322df0adf876bbdf8228c6df0 100644
--- a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc
@@ -34,39 +34,40 @@ bool ArcAppWindowLauncherItemController::HasAnyTasks() const {
return !task_ids_.empty();
}
-ash::ShelfAction ArcAppWindowLauncherItemController::ItemSelected(
- ui::EventType event_type,
- int event_flags,
+void ArcAppWindowLauncherItemController::ItemSelected(
+ std::unique_ptr<ui::Event> event,
int64_t display_id,
- ash::ShelfLaunchSource source) {
+ ash::ShelfLaunchSource source,
+ const ItemSelectedCallback& callback) {
if (window_count()) {
- return AppWindowLauncherItemController::ItemSelected(
- event_type, event_flags, display_id, source);
+ AppWindowLauncherItemController::ItemSelected(std::move(event), display_id,
+ source, callback);
+ return;
}
if (task_ids_.empty()) {
NOTREACHED();
- return ash::SHELF_ACTION_NONE;
+ callback.Run(ash::SHELF_ACTION_NONE, base::nullopt);
+ return;
}
arc::SetTaskActive(*task_ids_.begin());
- return ash::SHELF_ACTION_NEW_WINDOW_CREATED;
+ callback.Run(ash::SHELF_ACTION_NEW_WINDOW_CREATED, base::nullopt);
}
-ash::ShelfAppMenuItemList ArcAppWindowLauncherItemController::GetAppMenuItems(
+MenuItemList ArcAppWindowLauncherItemController::GetAppMenuItems(
int event_flags) {
- ash::ShelfAppMenuItemList items;
+ MenuItemList items;
base::string16 app_title = LauncherControllerHelper::GetAppTitle(
launcher_controller()->profile(), app_id());
for (auto it = windows().begin(); it != windows().end(); ++it) {
// TODO(khmel): resolve correct icon here.
size_t i = std::distance(windows().begin(), it);
- gfx::Image image;
aura::Window* window = (*it)->GetNativeWindow();
- items.push_back(base::MakeUnique<ash::ShelfApplicationMenuItem>(
- base::checked_cast<uint32_t>(i),
- ((window && !window->GetTitle().empty()) ? window->GetTitle()
- : app_title),
- &image));
+ ash::mojom::MenuItemPtr item = ash::mojom::MenuItem::New();
+ item->command_id = base::checked_cast<uint32_t>(i);
+ item->label = (window && !window->GetTitle().empty()) ? window->GetTitle()
+ : app_title;
+ items.push_back(std::move(item));
}
return items;
}

Powered by Google App Engine
This is Rietveld 408576698