| 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_support_host.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" |
| 11 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_item_controll
er.h" | 11 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_item_controll
er.h" |
| 12 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" | 12 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" |
| 13 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" | 13 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
| 14 #include "ui/gfx/canvas.h" | 14 #include "ui/gfx/canvas.h" |
| 15 #include "ui/gfx/image/canvas_image_source.h" | 15 #include "ui/gfx/image/canvas_image_source.h" |
| 16 #include "ui/gfx/image/image_skia_operations.h" | 16 #include "ui/gfx/image/image_skia_operations.h" |
| 17 #include "ui/gfx/paint_throbber.h" | 17 #include "ui/gfx/paint_throbber.h" |
| 18 | 18 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 const std::string shelf_app_id_; | 53 const std::string shelf_app_id_; |
| 54 const gfx::ImageSkia image_; | 54 const gfx::ImageSkia image_; |
| 55 | 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(SpinningEffectSource); | 56 DISALLOW_COPY_AND_ASSIGN(SpinningEffectSource); |
| 57 }; | 57 }; |
| 58 } // namespace | 58 } // namespace |
| 59 | 59 |
| 60 ArcAppDeferredLauncherController::ArcAppDeferredLauncherController( | 60 ArcAppDeferredLauncherController::ArcAppDeferredLauncherController( |
| 61 ChromeLauncherControllerImpl* owner) | 61 ChromeLauncherControllerImpl* owner) |
| 62 : owner_(owner), weak_ptr_factory_(this) { | 62 : owner_(owner), weak_ptr_factory_(this) { |
| 63 if (arc::ArcSessionManager::IsAllowedForProfile(owner->profile())) { | 63 if (arc::IsArcAllowedForProfile(owner->profile())) { |
| 64 observed_profile_ = owner->profile(); | 64 observed_profile_ = owner->profile(); |
| 65 ArcAppListPrefs::Get(observed_profile_)->AddObserver(this); | 65 ArcAppListPrefs::Get(observed_profile_)->AddObserver(this); |
| 66 } | 66 } |
| 67 arc::ArcSessionManager* arc_session_manager = arc::ArcSessionManager::Get(); | 67 arc::ArcSessionManager* arc_session_manager = arc::ArcSessionManager::Get(); |
| 68 // arc::ArcSessionManager might not be set in tests. | 68 // arc::ArcSessionManager might not be set in tests. |
| 69 if (arc_session_manager) | 69 if (arc_session_manager) |
| 70 arc_session_manager->AddObserver(this); | 70 arc_session_manager->AddObserver(this); |
| 71 } | 71 } |
| 72 | 72 |
| 73 ArcAppDeferredLauncherController::~ArcAppDeferredLauncherController() { | 73 ArcAppDeferredLauncherController::~ArcAppDeferredLauncherController() { |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |