| OLD | NEW |
| 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_deferred_launcher_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h" |
| 6 | 6 |
| 7 #include "base/threading/thread_task_runner_handle.h" | 7 #include "base/threading/thread_task_runner_handle.h" |
| 8 #include "chrome/browser/chromeos/arc/arc_util.h" | 8 #include "chrome/browser/chromeos/arc/arc_util.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_utils.h" | 10 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 void ArcAppDeferredLauncherController::OnAppRemoved(const std::string& app_id) { | 140 void ArcAppDeferredLauncherController::OnAppRemoved(const std::string& app_id) { |
| 141 Close(app_id); | 141 Close(app_id); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void ArcAppDeferredLauncherController::OnArcPlayStoreEnabledChanged( | 144 void ArcAppDeferredLauncherController::OnArcPlayStoreEnabledChanged( |
| 145 bool enabled) { | 145 bool enabled) { |
| 146 if (enabled) | 146 if (enabled) |
| 147 return; | 147 return; |
| 148 | 148 |
| 149 // If Arc was disabled, remove all deferred launch requests. | 149 // If ARC was disabled, remove all deferred launch requests. |
| 150 while (!app_controller_map_.empty()) | 150 while (!app_controller_map_.empty()) |
| 151 Close(app_controller_map_.begin()->first); | 151 Close(app_controller_map_.begin()->first); |
| 152 } | 152 } |
| 153 | 153 |
| 154 bool ArcAppDeferredLauncherController::HasApp(const std::string& app_id) const { | 154 bool ArcAppDeferredLauncherController::HasApp(const std::string& app_id) const { |
| 155 const std::string shelf_app_id = | 155 const std::string shelf_app_id = |
| 156 ArcAppWindowLauncherController::GetShelfAppIdFromArcAppId(app_id); | 156 ArcAppWindowLauncherController::GetShelfAppIdFromArcAppId(app_id); |
| 157 return app_controller_map_.count(shelf_app_id); | 157 return app_controller_map_.count(shelf_app_id); |
| 158 } | 158 } |
| 159 | 159 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 } else { | 211 } else { |
| 212 owner_->SetItemController(shelf_id, controller); | 212 owner_->SetItemController(shelf_id, controller); |
| 213 owner_->SetItemStatus(shelf_id, ash::STATUS_RUNNING); | 213 owner_->SetItemStatus(shelf_id, ash::STATUS_RUNNING); |
| 214 } | 214 } |
| 215 | 215 |
| 216 if (app_controller_map_.empty()) | 216 if (app_controller_map_.empty()) |
| 217 RegisterNextUpdate(); | 217 RegisterNextUpdate(); |
| 218 | 218 |
| 219 app_controller_map_[shelf_app_id] = controller; | 219 app_controller_map_[shelf_app_id] = controller; |
| 220 } | 220 } |
| OLD | NEW |