| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chrome_launcher_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 8 #include "chrome/browser/extensions/extension_app_icon_loader.h" | 9 #include "chrome/browser/extensions/extension_app_icon_loader.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h" | 11 #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h" |
| 11 #include "chrome/browser/ui/ash/ash_util.h" | 12 #include "chrome/browser/ui/ash/ash_util.h" |
| 12 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" | 13 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" |
| 13 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" | 14 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" |
| 14 #include "content/public/common/service_manager_connection.h" | 15 #include "content/public/common/service_manager_connection.h" |
| 15 #include "services/service_manager/public/cpp/connector.h" | 16 #include "services/service_manager/public/cpp/connector.h" |
| 16 #include "ui/display/display.h" | 17 #include "ui/display/display.h" |
| 17 #include "ui/display/screen.h" | 18 #include "ui/display/screen.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // TODO(skuhne): The AppIconLoaderImpl has the same problem. Each loaded | 136 // TODO(skuhne): The AppIconLoaderImpl has the same problem. Each loaded |
| 136 // image is associated with a profile (its loader requires the profile). | 137 // image is associated with a profile (its loader requires the profile). |
| 137 // Since icon size changes are possible, the icon could be requested to be | 138 // Since icon size changes are possible, the icon could be requested to be |
| 138 // reloaded. However - having it not multi profile aware would cause problems | 139 // reloaded. However - having it not multi profile aware would cause problems |
| 139 // if the icon cache gets deleted upon user switch. | 140 // if the icon cache gets deleted upon user switch. |
| 140 std::unique_ptr<AppIconLoader> extension_app_icon_loader = | 141 std::unique_ptr<AppIconLoader> extension_app_icon_loader = |
| 141 base::MakeUnique<extensions::ExtensionAppIconLoader>( | 142 base::MakeUnique<extensions::ExtensionAppIconLoader>( |
| 142 profile_, extension_misc::EXTENSION_ICON_SMALL, this); | 143 profile_, extension_misc::EXTENSION_ICON_SMALL, this); |
| 143 app_icon_loaders_.push_back(std::move(extension_app_icon_loader)); | 144 app_icon_loaders_.push_back(std::move(extension_app_icon_loader)); |
| 144 | 145 |
| 145 if (arc::ArcSessionManager::IsAllowedForProfile(profile_)) { | 146 if (arc::util::IsArcAllowedForProfile(profile_)) { |
| 146 std::unique_ptr<AppIconLoader> arc_app_icon_loader = | 147 std::unique_ptr<AppIconLoader> arc_app_icon_loader = |
| 147 base::MakeUnique<ArcAppIconLoader>( | 148 base::MakeUnique<ArcAppIconLoader>( |
| 148 profile_, extension_misc::EXTENSION_ICON_SMALL, this); | 149 profile_, extension_misc::EXTENSION_ICON_SMALL, this); |
| 149 app_icon_loaders_.push_back(std::move(arc_app_icon_loader)); | 150 app_icon_loaders_.push_back(std::move(arc_app_icon_loader)); |
| 150 } | 151 } |
| 151 } | 152 } |
| 152 | 153 |
| 153 void ChromeLauncherController::OnShelfCreated(int64_t display_id) { | 154 void ChromeLauncherController::OnShelfCreated(int64_t display_id) { |
| 154 if (!ConnectToShelfController()) | 155 if (!ConnectToShelfController()) |
| 155 return; | 156 return; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 181 // TODO(msw): Avoid handling this pref change and forwarding the value to ash. | 182 // TODO(msw): Avoid handling this pref change and forwarding the value to ash. |
| 182 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), display_id, | 183 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), display_id, |
| 183 auto_hide); | 184 auto_hide); |
| 184 } | 185 } |
| 185 | 186 |
| 186 void ChromeLauncherController::OnAppImageUpdated(const std::string& app_id, | 187 void ChromeLauncherController::OnAppImageUpdated(const std::string& app_id, |
| 187 const gfx::ImageSkia& image) { | 188 const gfx::ImageSkia& image) { |
| 188 // Implemented by subclasses; this should not be called. | 189 // Implemented by subclasses; this should not be called. |
| 189 NOTREACHED(); | 190 NOTREACHED(); |
| 190 } | 191 } |
| OLD | NEW |