| 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/extensions/extension_app_icon_loader.h" | 8 #include "chrome/browser/extensions/extension_app_icon_loader.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_icon_loader.h" | 10 #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 bool ChromeLauncherController::ConnectToShelfController() { | 53 bool ChromeLauncherController::ConnectToShelfController() { |
| 54 if (shelf_controller_.is_bound()) | 54 if (shelf_controller_.is_bound()) |
| 55 return true; | 55 return true; |
| 56 | 56 |
| 57 auto connection = content::ServiceManagerConnection::GetForProcess(); | 57 auto connection = content::ServiceManagerConnection::GetForProcess(); |
| 58 auto connector = connection ? connection->GetConnector() : nullptr; | 58 auto connector = connection ? connection->GetConnector() : nullptr; |
| 59 // Unit tests may not have a connector. | 59 // Unit tests may not have a connector. |
| 60 if (!connector) | 60 if (!connector) |
| 61 return false; | 61 return false; |
| 62 | 62 |
| 63 connector->ConnectToInterface(ash_util::GetAshServiceName(), | 63 connector->BindInterface(ash_util::GetAshServiceName(), &shelf_controller_); |
| 64 &shelf_controller_); | |
| 65 return true; | 64 return true; |
| 66 } | 65 } |
| 67 | 66 |
| 68 AppIconLoader* ChromeLauncherController::GetAppIconLoaderForApp( | 67 AppIconLoader* ChromeLauncherController::GetAppIconLoaderForApp( |
| 69 const std::string& app_id) { | 68 const std::string& app_id) { |
| 70 for (const auto& app_icon_loader : app_icon_loaders_) { | 69 for (const auto& app_icon_loader : app_icon_loaders_) { |
| 71 if (app_icon_loader->CanLoadImageForApp(app_id)) | 70 if (app_icon_loader->CanLoadImageForApp(app_id)) |
| 72 return app_icon_loader.get(); | 71 return app_icon_loader.get(); |
| 73 } | 72 } |
| 74 | 73 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 // TODO(msw): Avoid handling this pref change and forwarding the value to ash. | 181 // TODO(msw): Avoid handling this pref change and forwarding the value to ash. |
| 183 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), display_id, | 182 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), display_id, |
| 184 auto_hide); | 183 auto_hide); |
| 185 } | 184 } |
| 186 | 185 |
| 187 void ChromeLauncherController::OnAppImageUpdated(const std::string& app_id, | 186 void ChromeLauncherController::OnAppImageUpdated(const std::string& app_id, |
| 188 const gfx::ImageSkia& image) { | 187 const gfx::ImageSkia& image) { |
| 189 // Implemented by subclasses; this should not be called. | 188 // Implemented by subclasses; this should not be called. |
| 190 NOTREACHED(); | 189 NOTREACHED(); |
| 191 } | 190 } |
| OLD | NEW |