| 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/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "chrome/browser/chromeos/arc/arc_util.h" | |
| 10 #include "chrome/browser/extensions/extension_app_icon_loader.h" | 9 #include "chrome/browser/extensions/extension_app_icon_loader.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 12 #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" |
| 13 #include "chrome/browser/ui/ash/ash_util.h" | 12 #include "chrome/browser/ui/ash/ash_util.h" |
| 14 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" | 13 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" |
| 15 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" | 14 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" |
| 16 #include "content/public/common/service_manager_connection.h" | 15 #include "content/public/common/service_manager_connection.h" |
| 17 #include "services/service_manager/public/cpp/connector.h" | 16 #include "services/service_manager/public/cpp/connector.h" |
| 18 #include "ui/display/display.h" | 17 #include "ui/display/display.h" |
| 19 #include "ui/display/screen.h" | 18 #include "ui/display/screen.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 // TODO(skuhne): The AppIconLoaderImpl has the same problem. Each loaded | 140 // TODO(skuhne): The AppIconLoaderImpl has the same problem. Each loaded |
| 142 // image is associated with a profile (its loader requires the profile). | 141 // image is associated with a profile (its loader requires the profile). |
| 143 // Since icon size changes are possible, the icon could be requested to be | 142 // Since icon size changes are possible, the icon could be requested to be |
| 144 // reloaded. However - having it not multi profile aware would cause problems | 143 // reloaded. However - having it not multi profile aware would cause problems |
| 145 // if the icon cache gets deleted upon user switch. | 144 // if the icon cache gets deleted upon user switch. |
| 146 std::unique_ptr<AppIconLoader> extension_app_icon_loader = | 145 std::unique_ptr<AppIconLoader> extension_app_icon_loader = |
| 147 base::MakeUnique<extensions::ExtensionAppIconLoader>( | 146 base::MakeUnique<extensions::ExtensionAppIconLoader>( |
| 148 profile_, extension_misc::EXTENSION_ICON_SMALL, this); | 147 profile_, extension_misc::EXTENSION_ICON_SMALL, this); |
| 149 app_icon_loaders_.push_back(std::move(extension_app_icon_loader)); | 148 app_icon_loaders_.push_back(std::move(extension_app_icon_loader)); |
| 150 | 149 |
| 151 if (arc::IsArcAllowedForProfile(profile_)) { | 150 if (arc::ArcSessionManager::IsAllowedForProfile(profile_)) { |
| 152 std::unique_ptr<AppIconLoader> arc_app_icon_loader = | 151 std::unique_ptr<AppIconLoader> arc_app_icon_loader = |
| 153 base::MakeUnique<ArcAppIconLoader>( | 152 base::MakeUnique<ArcAppIconLoader>( |
| 154 profile_, extension_misc::EXTENSION_ICON_SMALL, this); | 153 profile_, extension_misc::EXTENSION_ICON_SMALL, this); |
| 155 app_icon_loaders_.push_back(std::move(arc_app_icon_loader)); | 154 app_icon_loaders_.push_back(std::move(arc_app_icon_loader)); |
| 156 } | 155 } |
| 157 | 156 |
| 158 SetShelfBehaviorsFromPrefs(); | 157 SetShelfBehaviorsFromPrefs(); |
| 159 } | 158 } |
| 160 | 159 |
| 161 void ChromeLauncherController::OnShelfCreated(int64_t display_id) { | 160 void ChromeLauncherController::OnShelfCreated(int64_t display_id) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 191 // This will uselessly store a preference value for invalid display ids. | 190 // This will uselessly store a preference value for invalid display ids. |
| 192 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), display_id, | 191 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), display_id, |
| 193 auto_hide); | 192 auto_hide); |
| 194 } | 193 } |
| 195 | 194 |
| 196 void ChromeLauncherController::OnAppImageUpdated(const std::string& app_id, | 195 void ChromeLauncherController::OnAppImageUpdated(const std::string& app_id, |
| 197 const gfx::ImageSkia& image) { | 196 const gfx::ImageSkia& image) { |
| 198 // Implemented by subclasses; this should not be called. | 197 // Implemented by subclasses; this should not be called. |
| 199 NOTREACHED(); | 198 NOTREACHED(); |
| 200 } | 199 } |
| OLD | NEW |