Chromium Code Reviews| Index: chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.cc |
| diff --git a/chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.cc b/chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.cc |
| index ea088d259a95216c6da5764382af20845fef2a4c..07eeb9afacd64cb3a67daee346f066e7297b3d23 100644 |
| --- a/chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.cc |
| +++ b/chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.cc |
| @@ -111,7 +111,7 @@ void ArcAppDeferredLauncherController::Close(const std::string& app_id) { |
| if (it == app_controller_map_.end()) |
| return; |
| - const ash::ShelfID shelf_id = owner_->GetShelfIDForAppID(shelf_app_id); |
| + const ash::ShelfID shelf_id(shelf_app_id); |
| const bool need_close_item = |
| it->second == owner_->shelf_model()->GetShelfItemDelegate(shelf_id); |
| app_controller_map_.erase(it); |
| @@ -197,7 +197,7 @@ void ArcAppDeferredLauncherController::RegisterDeferredLaunch( |
| const std::string shelf_app_id = |
| ArcAppWindowLauncherController::GetShelfAppIdFromArcAppId(app_id); |
| - const ash::ShelfID shelf_id = owner_->GetShelfIDForAppID(shelf_app_id); |
| + const ash::ShelfID shelf_id(shelf_app_id); |
| // We are allowed to apply new deferred controller only over non-active items. |
| const ash::ShelfItem* item = owner_->GetItem(shelf_id); |
| @@ -207,8 +207,8 @@ void ArcAppDeferredLauncherController::RegisterDeferredLaunch( |
| std::unique_ptr<ArcAppDeferredLauncherItemController> controller = |
| base::MakeUnique<ArcAppDeferredLauncherItemController>( |
| shelf_app_id, event_flags, weak_ptr_factory_.GetWeakPtr()); |
| - ArcAppDeferredLauncherItemController* item_controller = controller.get(); |
| - if (shelf_id.IsNull()) { |
| + app_controller_map_[shelf_app_id] = controller.get(); |
|
James Cook
2017/05/10 02:51:18
Is it safe to move this up? Won't that mean the if
msw
2017/05/10 18:21:53
Good catch, I reverted this part of the change. Th
|
| + if (item == nullptr) { |
| owner_->CreateAppLauncherItem(std::move(controller), ash::STATUS_RUNNING); |
| } else { |
| owner_->shelf_model()->SetShelfItemDelegate(shelf_id, |
| @@ -218,6 +218,4 @@ void ArcAppDeferredLauncherController::RegisterDeferredLaunch( |
| if (app_controller_map_.empty()) |
| RegisterNextUpdate(); |
| - |
| - app_controller_map_[shelf_app_id] = item_controller; |
| } |