| 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 "ash/public/interfaces/constants.mojom.h" |
| 7 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
| 8 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 9 #include "chrome/browser/chromeos/arc/arc_util.h" | 10 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 10 #include "chrome/browser/extensions/extension_app_icon_loader.h" | 11 #include "chrome/browser/extensions/extension_app_icon_loader.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h" | 13 #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h" |
| 13 #include "chrome/browser/ui/ash/ash_util.h" | |
| 14 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" | 14 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" |
| 15 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" | 15 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" |
| 16 #include "content/public/common/service_manager_connection.h" | 16 #include "content/public/common/service_manager_connection.h" |
| 17 #include "services/service_manager/public/cpp/connector.h" | 17 #include "services/service_manager/public/cpp/connector.h" |
| 18 #include "ui/display/display.h" | 18 #include "ui/display/display.h" |
| 19 #include "ui/display/screen.h" | 19 #include "ui/display/screen.h" |
| 20 | 20 |
| 21 // static | 21 // static |
| 22 ChromeLauncherController* ChromeLauncherController::instance_ = nullptr; | 22 ChromeLauncherController* ChromeLauncherController::instance_ = nullptr; |
| 23 | 23 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 50 bool ChromeLauncherController::ConnectToShelfController() { | 50 bool ChromeLauncherController::ConnectToShelfController() { |
| 51 if (shelf_controller_.is_bound()) | 51 if (shelf_controller_.is_bound()) |
| 52 return true; | 52 return true; |
| 53 | 53 |
| 54 auto connection = content::ServiceManagerConnection::GetForProcess(); | 54 auto connection = content::ServiceManagerConnection::GetForProcess(); |
| 55 auto connector = connection ? connection->GetConnector() : nullptr; | 55 auto connector = connection ? connection->GetConnector() : nullptr; |
| 56 // Unit tests may not have a connector. | 56 // Unit tests may not have a connector. |
| 57 if (!connector) | 57 if (!connector) |
| 58 return false; | 58 return false; |
| 59 | 59 |
| 60 connector->BindInterface(ash_util::GetAshServiceName(), &shelf_controller_); | 60 connector->BindInterface(ash::mojom::kServiceName, &shelf_controller_); |
| 61 return true; | 61 return true; |
| 62 } | 62 } |
| 63 | 63 |
| 64 AppIconLoader* ChromeLauncherController::GetAppIconLoaderForApp( | 64 AppIconLoader* ChromeLauncherController::GetAppIconLoaderForApp( |
| 65 const std::string& app_id) { | 65 const std::string& app_id) { |
| 66 for (const auto& app_icon_loader : app_icon_loaders_) { | 66 for (const auto& app_icon_loader : app_icon_loaders_) { |
| 67 if (app_icon_loader->CanLoadImageForApp(app_id)) | 67 if (app_icon_loader->CanLoadImageForApp(app_id)) |
| 68 return app_icon_loader.get(); | 68 return app_icon_loader.get(); |
| 69 } | 69 } |
| 70 | 70 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 // This will uselessly store a preference value for invalid display ids. | 182 // This will uselessly store a preference value for invalid display ids. |
| 183 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), display_id, | 183 ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(), display_id, |
| 184 auto_hide); | 184 auto_hide); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void ChromeLauncherController::OnAppImageUpdated(const std::string& app_id, | 187 void ChromeLauncherController::OnAppImageUpdated(const std::string& app_id, |
| 188 const gfx::ImageSkia& image) { | 188 const gfx::ImageSkia& image) { |
| 189 // Implemented by subclasses; this should not be called. | 189 // Implemented by subclasses; this should not be called. |
| 190 NOTREACHED(); | 190 NOTREACHED(); |
| 191 } | 191 } |
| OLD | NEW |