Chromium Code Reviews| Index: chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc |
| diff --git a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc |
| index cc480b7427e3ec2cb2a9078371bec849e161934a..b395f4700a0dd585d59e642c1a846d535a1fdf62 100644 |
| --- a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc |
| +++ b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc |
| @@ -654,13 +654,12 @@ ArcAppWindowLauncherController::AttachControllerToTask( |
| base::MakeUnique<ArcAppWindowLauncherItemController>( |
| app_shelf_id.ToString()); |
| ArcAppWindowLauncherItemController* item_controller = controller.get(); |
| - ash::ShelfModel* shelf_model = ash::Shell::Get()->shelf_model(); |
| - const ash::ShelfID shelf_id = |
| - shelf_model->GetShelfIDForAppID(app_shelf_id.ToString()); |
| - if (shelf_id.IsNull()) { |
| + const ash::ShelfID shelf_id(app_shelf_id.ToString()); |
| + if (owner()->GetItem(shelf_id) == nullptr) { |
|
James Cook
2017/05/10 02:51:18
Yeah, I think HasItem() would be easier to read.
msw
2017/05/10 18:21:53
I'm using TRUE/FALSE for test expectations, and I
James Cook
2017/05/10 19:29:35
Yeah, I think the TRUE/FALSE works well enough.
|
| owner()->CreateAppLauncherItem(std::move(controller), ash::STATUS_RUNNING); |
| } else { |
| - shelf_model->SetShelfItemDelegate(shelf_id, std::move(controller)); |
| + owner()->shelf_model()->SetShelfItemDelegate(shelf_id, |
| + std::move(controller)); |
| owner()->SetItemStatus(shelf_id, ash::STATUS_RUNNING); |
| } |
| item_controller->AddTaskId(task_id); |
| @@ -673,12 +672,9 @@ void ArcAppWindowLauncherController::RegisterApp( |
| AppWindow* app_window = app_window_info->app_window(); |
| ArcAppWindowLauncherItemController* controller = |
| AttachControllerToTask(app_window->task_id(), *app_window_info); |
| - DCHECK(controller); |
| - |
| - const ash::ShelfID shelf_id = |
| - ash::Shell::Get()->shelf_model()->GetShelfIDForAppID( |
| - controller->app_id()); |
| - DCHECK(!shelf_id.IsNull()); |
| + DCHECK(!controller->app_id().empty()); |
| + const ash::ShelfID shelf_id(controller->app_id()); |
| + DCHECK_NE(nullptr, owner()->GetItem(shelf_id)); |
| controller->AddWindow(app_window); |
| owner()->SetItemStatus(shelf_id, ash::STATUS_RUNNING); |