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

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

Issue 2791803002: mash: Move LauncherItemController to ash, rename ShelfItemDelegate. (Closed)
Patch Set: Sync and rebase. Created 3 years, 8 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/extension_app_window_launcher_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc
index 7aac24658ca3f8ecb754ffcd266be4b732b7afdd..669ce2e854d4b97f28dcc820afab9b97372082fe 100644
--- a/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc
@@ -166,9 +166,12 @@ void ExtensionAppWindowLauncherController::RegisterApp(AppWindow* app_window) {
controller->AddAppWindow(app_window);
} else {
std::string launch_id = GetLaunchId(app_window);
- ExtensionAppWindowLauncherItemController* controller =
- new ExtensionAppWindowLauncherItemController(
- ash::AppLaunchId(app_id, launch_id), owner());
+ std::unique_ptr<ExtensionAppWindowLauncherItemController> controller =
+ base::MakeUnique<ExtensionAppWindowLauncherItemController>(
+ ash::AppLaunchId(app_id, launch_id));
+ ExtensionAppWindowLauncherItemController* item_controller =
+ controller.get();
+
controller->AddAppWindow(app_window);
// If there is already a shelf id mapped to this AppLaunchId (e.g. pinned),
// use that shelf item.
@@ -177,19 +180,19 @@ void ExtensionAppWindowLauncherController::RegisterApp(AppWindow* app_window) {
app_id, launch_id);
if (shelf_id == 0) {
- shelf_id = owner()->CreateAppLauncherItem(controller, status);
+ shelf_id = owner()->CreateAppLauncherItem(std::move(controller), status);
// Restore any existing app icon and flag as set.
const gfx::Image& app_icon = app_window->app_icon();
if (!app_icon.IsEmpty()) {
owner()->SetLauncherItemImage(shelf_id, app_icon.AsImageSkia());
- controller->set_image_set_by_controller(true);
+ item_controller->set_image_set_by_controller(true);
}
} else {
- owner()->SetItemController(shelf_id, controller);
+ owner()->SetShelfItemDelegate(shelf_id, std::move(controller));
}
// We need to change the controller associated with app_shelf_id.
- app_controller_map_[app_shelf_id] = controller;
+ app_controller_map_[app_shelf_id] = item_controller;
}
owner()->SetItemStatus(shelf_id, status);
ash::WmWindow::Get(window)->aura_window()->SetProperty(ash::kShelfIDKey,

Powered by Google App Engine
This is Rietveld 408576698