| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 const std::string shelf_app_id = | 196 const std::string shelf_app_id = |
| 197 ArcAppWindowLauncherController::GetShelfAppIdFromArcAppId(app_id); | 197 ArcAppWindowLauncherController::GetShelfAppIdFromArcAppId(app_id); |
| 198 const ash::ShelfID shelf_id = owner_->GetShelfIDForAppID(shelf_app_id); | 198 const ash::ShelfID shelf_id = owner_->GetShelfIDForAppID(shelf_app_id); |
| 199 | 199 |
| 200 // We are allowed to apply new deferred controller only over non-active items. | 200 // We are allowed to apply new deferred controller only over non-active items. |
| 201 const ash::ShelfItem* item = owner_->GetItem(shelf_id); | 201 const ash::ShelfItem* item = owner_->GetItem(shelf_id); |
| 202 if (item && item->status != ash::STATUS_CLOSED) | 202 if (item && item->status != ash::STATUS_CLOSED) |
| 203 return; | 203 return; |
| 204 | 204 |
| 205 ArcAppDeferredLauncherItemController* controller = | 205 ArcAppDeferredLauncherItemController* controller = |
| 206 new ArcAppDeferredLauncherItemController( | 206 new ArcAppDeferredLauncherItemController(shelf_app_id, event_flags, |
| 207 shelf_app_id, owner_, event_flags, weak_ptr_factory_.GetWeakPtr()); | 207 weak_ptr_factory_.GetWeakPtr()); |
| 208 if (shelf_id == 0) { | 208 if (shelf_id == 0) { |
| 209 owner_->CreateAppLauncherItem(controller, ash::STATUS_RUNNING); | 209 owner_->CreateAppLauncherItem(controller, ash::STATUS_RUNNING); |
| 210 } else { | 210 } else { |
| 211 owner_->SetItemController(shelf_id, controller); | 211 owner_->SetItemController(shelf_id, controller); |
| 212 owner_->SetItemStatus(shelf_id, ash::STATUS_RUNNING); | 212 owner_->SetItemStatus(shelf_id, ash::STATUS_RUNNING); |
| 213 } | 213 } |
| 214 | 214 |
| 215 if (app_controller_map_.empty()) | 215 if (app_controller_map_.empty()) |
| 216 RegisterNextUpdate(); | 216 RegisterNextUpdate(); |
| 217 | 217 |
| 218 app_controller_map_[shelf_app_id] = controller; | 218 app_controller_map_[shelf_app_id] = controller; |
| 219 } | 219 } |
| OLD | NEW |