diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 166471009f138d..be3a5cd9e2e95f 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -85,7 +85,6 @@ #include "chrome/browser/tab_contents/tab_util.h" #include "chrome/browser/tracing/chrome_tracing_delegate.h" #include "chrome/browser/translate/chrome_translate_client.h" -#include "chrome/browser/ui/ash/ash_util.h" #include "chrome/browser/ui/blocked_content/blocked_window_params.h" #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" #include "chrome/browser/ui/browser_navigator.h" @@ -218,6 +217,7 @@ #elif defined(OS_MACOSX) #include "chrome/browser/chrome_browser_main_mac.h" #elif defined(OS_CHROMEOS) +#include "ash/public/interfaces/constants.mojom.h" #include "chrome/browser/chromeos/arc/arc_util.h" #include "chrome/browser/chromeos/arc/fileapi/arc_content_file_system_backend_delegate.h" #include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_backend_delegate.h" @@ -3245,7 +3245,7 @@ void ChromeContentBrowserClient::RegisterInProcessServices( content::ServiceInfo info; info.factory = base::Bind(&ash_util::CreateEmbeddedAshService, base::ThreadTaskRunnerHandle::Get()); - services->insert(std::make_pair("ash", info)); + services->insert(std::make_pair(ash::mojom::kServiceName, info)); } #endif // OS_CHROMEOS } diff --git a/chrome/browser/chromeos/locale_change_guard.cc b/chrome/browser/chromeos/locale_change_guard.cc index e3eeecfa83d5b3..2446aad4d76012 100644 --- a/chrome/browser/chromeos/locale_change_guard.cc +++ b/chrome/browser/chromeos/locale_change_guard.cc @@ -6,6 +6,7 @@ #include +#include "ash/public/interfaces/constants.mojom.h" #include "base/bind.h" #include "base/macros.h" #include "base/strings/utf_string_conversions.h" @@ -15,7 +16,6 @@ #include "chrome/browser/chromeos/settings/device_settings_service.h" #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/ash/ash_util.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/common/pref_names.h" @@ -72,8 +72,7 @@ void LocaleChangeGuard::ConnectToLocaleNotificationController() { if (!connector) return; - connector->BindInterface(ash_util::GetAshServiceName(), - ¬ification_controller_); + connector->BindInterface(ash::mojom::kServiceName, ¬ification_controller_); } void LocaleChangeGuard::RevertLocaleChange() { diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc index cd1566ba705a2f..ef070f78a2dc2c 100644 --- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc +++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc @@ -9,6 +9,7 @@ #include "ash/common/ash_constants.h" #include "ash/common/wallpaper/wallpaper_controller.h" #include "ash/common/wm_shell.h" +#include "ash/public/interfaces/constants.mojom.h" #include "base/bind.h" #include "base/bind_helpers.h" #include "base/command_line.h" @@ -205,8 +206,7 @@ void SetWallpaper(const gfx::ImageSkia& image, return; ash::mojom::WallpaperControllerPtr wallpaper_controller; - connector->BindInterface(ash_util::GetAshServiceName(), - &wallpaper_controller); + connector->BindInterface(ash::mojom::kServiceName, &wallpaper_controller); // TODO(crbug.com/655875): Optimize ash wallpaper transport; avoid sending // large bitmaps over Mojo; use shared memory like BitmapUploader, etc. wallpaper_controller->SetWallpaper(*image.bitmap(), layout); @@ -888,7 +888,7 @@ WallpaperManager::WallpaperManager() if (connection && connection->GetConnector()) { // Connect to the wallpaper controller interface in the ash service. ash::mojom::WallpaperControllerPtr wallpaper_controller_ptr; - connection->GetConnector()->BindInterface(ash_util::GetAshServiceName(), + connection->GetConnector()->BindInterface(ash::mojom::kServiceName, &wallpaper_controller_ptr); // Register this object as the wallpaper picker. wallpaper_controller_ptr->SetWallpaperPicker( diff --git a/chrome/browser/chromeos/settings/shutdown_policy_forwarder.cc b/chrome/browser/chromeos/settings/shutdown_policy_forwarder.cc index f48aae0d315163..70228895f784db 100644 --- a/chrome/browser/chromeos/settings/shutdown_policy_forwarder.cc +++ b/chrome/browser/chromeos/settings/shutdown_policy_forwarder.cc @@ -4,9 +4,9 @@ #include "chrome/browser/chromeos/settings/shutdown_policy_forwarder.h" +#include "ash/public/interfaces/constants.mojom.h" #include "ash/public/interfaces/shutdown.mojom.h" #include "chrome/browser/chromeos/settings/cros_settings.h" -#include "chrome/browser/ui/ash/ash_util.h" #include "content/public/common/service_manager_connection.h" #include "services/service_manager/public/cpp/connector.h" @@ -25,7 +25,7 @@ void ShutdownPolicyForwarder::OnShutdownPolicyChanged(bool reboot_on_shutdown) { ash::mojom::ShutdownControllerPtr shutdown_controller; content::ServiceManagerConnection::GetForProcess() ->GetConnector() - ->BindInterface(ash_util::GetAshServiceName(), &shutdown_controller); + ->BindInterface(ash::mojom::kServiceName, &shutdown_controller); // Forward the setting to ash. shutdown_controller->SetRebootOnShutdown(reboot_on_shutdown); diff --git a/chrome/browser/ui/ash/app_list/app_list_presenter_service.cc b/chrome/browser/ui/ash/app_list/app_list_presenter_service.cc index 1a706fb72ae04f..15cd30ca515fbe 100644 --- a/chrome/browser/ui/ash/app_list/app_list_presenter_service.cc +++ b/chrome/browser/ui/ash/app_list/app_list_presenter_service.cc @@ -4,8 +4,8 @@ #include "chrome/browser/ui/ash/app_list/app_list_presenter_service.h" +#include "ash/public/interfaces/constants.mojom.h" #include "chrome/browser/ui/ash/app_list/app_list_service_ash.h" -#include "chrome/browser/ui/ash/ash_util.h" #include "content/public/common/service_manager_connection.h" #include "services/service_manager/public/cpp/connector.h" #include "ui/app_list/presenter/app_list_presenter_impl.h" @@ -16,7 +16,7 @@ AppListPresenterService::AppListPresenterService() : binding_(this) { if (connection && connection->GetConnector()) { // Connect to the app list interface in the ash service. app_list::mojom::AppListPtr app_list_ptr; - connection->GetConnector()->BindInterface(ash_util::GetAshServiceName(), + connection->GetConnector()->BindInterface(ash::mojom::kServiceName, &app_list_ptr); // Register this object as the app list presenter. app_list_ptr->SetAppListPresenter(binding_.CreateInterfacePtrAndBind()); diff --git a/chrome/browser/ui/ash/ash_util.cc b/chrome/browser/ui/ash/ash_util.cc index 3209292593108b..7188b70b93ce36 100644 --- a/chrome/browser/ui/ash/ash_util.cc +++ b/chrome/browser/ui/ash/ash_util.cc @@ -49,11 +49,6 @@ class EmbeddedAshService : public service_manager::Service { } // namespace -// TODO(rockot): Remove this. -const char* GetAshServiceName() { - return "ash"; -} - std::unique_ptr CreateEmbeddedAshService( const scoped_refptr& task_runner) { return base::MakeUnique(task_runner); diff --git a/chrome/browser/ui/ash/ash_util.h b/chrome/browser/ui/ash/ash_util.h index 8f9054424507d4..f267bc602673f1 100644 --- a/chrome/browser/ui/ash/ash_util.h +++ b/chrome/browser/ui/ash/ash_util.h @@ -20,10 +20,6 @@ class Accelerator; namespace ash_util { -// Returns the name of the ash service depending on whether the browser is -// running in classic ash or mash. -const char* GetAshServiceName(); - // Creates an in-process Service instance of which can host common ash // interfaces. std::unique_ptr CreateEmbeddedAshService( diff --git a/chrome/browser/ui/ash/cast_config_client_media_router.cc b/chrome/browser/ui/ash/cast_config_client_media_router.cc index d9ba5ac5846ef0..9074423def4f9c 100644 --- a/chrome/browser/ui/ash/cast_config_client_media_router.cc +++ b/chrome/browser/ui/ash/cast_config_client_media_router.cc @@ -8,6 +8,7 @@ #include #include +#include "ash/public/interfaces/constants.mojom.h" #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/optional.h" @@ -21,7 +22,6 @@ #include "chrome/browser/media/router/media_sinks_observer.h" #include "chrome/browser/media/router/media_source_helper.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/ash/ash_util.h" #include "chrome/common/url_constants.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" @@ -151,7 +151,7 @@ CastConfigClientMediaRouter::CastConfigClientMediaRouter() : binding_(this) { // client. content::ServiceManagerConnection::GetForProcess() ->GetConnector() - ->BindInterface(ash_util::GetAshServiceName(), &cast_config_); + ->BindInterface(ash::mojom::kServiceName, &cast_config_); // Register this object as the client interface implementation. ash::mojom::CastConfigClientAssociatedPtrInfo ptr_info; diff --git a/chrome/browser/ui/ash/chrome_new_window_client.cc b/chrome/browser/ui/ash/chrome_new_window_client.cc index c85da53e9cef81..90f4deed9f5873 100644 --- a/chrome/browser/ui/ash/chrome_new_window_client.cc +++ b/chrome/browser/ui/ash/chrome_new_window_client.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/ash/chrome_new_window_client.h" #include "ash/content/keyboard_overlay/keyboard_overlay_view.h" +#include "ash/public/interfaces/constants.mojom.h" #include "base/macros.h" #include "chrome/browser/chromeos/file_manager/app_id.h" #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" @@ -12,7 +13,6 @@ #include "chrome/browser/extensions/extension_util.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/sessions/tab_restore_service_factory.h" -#include "chrome/browser/ui/ash/ash_util.h" #include "chrome/browser/ui/ash/chrome_shell_delegate.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" @@ -61,8 +61,7 @@ Browser* ChromeNewWindowClient::GetActiveBrowser() { ChromeNewWindowClient::ChromeNewWindowClient() : binding_(this) { service_manager::Connector* connector = content::ServiceManagerConnection::GetForProcess()->GetConnector(); - connector->BindInterface(ash_util::GetAshServiceName(), - &new_window_controller_); + connector->BindInterface(ash::mojom::kServiceName, &new_window_controller_); // Register this object as the client interface implementation. ash::mojom::NewWindowClientAssociatedPtrInfo ptr_info; diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc index 52692bcb09d8b5..b938dc884df2ba 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc @@ -4,13 +4,13 @@ #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" +#include "ash/public/interfaces/constants.mojom.h" #include "base/auto_reset.h" #include "base/memory/ptr_util.h" #include "chrome/browser/chromeos/arc/arc_util.h" #include "chrome/browser/extensions/extension_app_icon_loader.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h" -#include "chrome/browser/ui/ash/ash_util.h" #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" #include "content/public/common/service_manager_connection.h" @@ -57,7 +57,7 @@ bool ChromeLauncherController::ConnectToShelfController() { if (!connector) return false; - connector->BindInterface(ash_util::GetAshServiceName(), &shelf_controller_); + connector->BindInterface(ash::mojom::kServiceName, &shelf_controller_); return true; } diff --git a/chrome/browser/ui/ash/media_client.cc b/chrome/browser/ui/ash/media_client.cc index 99ed587abdd093..a8affc52fbf1d4 100644 --- a/chrome/browser/ui/ash/media_client.cc +++ b/chrome/browser/ui/ash/media_client.cc @@ -4,6 +4,7 @@ #include "chrome/browser/ui/ash/media_client.h" +#include "ash/public/interfaces/constants.mojom.h" #include "base/location.h" #include "base/logging.h" #include "base/message_loop/message_loop.h" @@ -13,7 +14,6 @@ #include "chrome/browser/chromeos/extensions/media_player_event_router.h" #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/ash/ash_util.h" #include "chrome/browser/ui/ash/chrome_shell_content_state.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" @@ -132,7 +132,7 @@ MediaClient::MediaClient() : binding_(this), weak_ptr_factory_(this) { service_manager::Connector* connector = content::ServiceManagerConnection::GetForProcess()->GetConnector(); - connector->BindInterface(ash_util::GetAshServiceName(), &media_controller_); + connector->BindInterface(ash::mojom::kServiceName, &media_controller_); // Register this object as the client interface implementation. ash::mojom::MediaClientAssociatedPtrInfo ptr_info; diff --git a/chrome/browser/ui/ash/session_controller_client.cc b/chrome/browser/ui/ash/session_controller_client.cc index 76a8a4865c96c9..bc659c8e04ac89 100644 --- a/chrome/browser/ui/ash/session_controller_client.cc +++ b/chrome/browser/ui/ash/session_controller_client.cc @@ -8,13 +8,13 @@ #include #include "ash/public/cpp/session_types.h" +#include "ash/public/interfaces/constants.mojom.h" #include "base/bind.h" #include "base/logging.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" #include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/ash/ash_util.h" #include "chrome/browser/ui/ash/multi_user/user_switch_util.h" #include "chrome/common/pref_names.h" #include "chrome/grit/theme_resources.h" @@ -246,7 +246,7 @@ void SessionControllerClient::OnSessionStateChanged() { void SessionControllerClient::ConnectToSessionControllerAndSetClient() { content::ServiceManagerConnection::GetForProcess() ->GetConnector() - ->BindInterface(ash_util::GetAshServiceName(), &session_controller_); + ->BindInterface(ash::mojom::kServiceName, &session_controller_); // Set as |session_controller_|'s client. session_controller_->SetClient(binding_.CreateInterfacePtrAndBind()); diff --git a/chrome/browser/ui/ash/system_tray_client.cc b/chrome/browser/ui/ash/system_tray_client.cc index aec8fe2534658d..1bbcbcefb80fac 100644 --- a/chrome/browser/ui/ash/system_tray_client.cc +++ b/chrome/browser/ui/ash/system_tray_client.cc @@ -7,6 +7,7 @@ #include "ash/common/login_status.h" #include "ash/common/wm_shell.h" #include "ash/public/cpp/shell_window_ids.h" +#include "ash/public/interfaces/constants.mojom.h" #include "ash/shell.h" #include "base/feature_list.h" #include "base/logging.h" @@ -86,7 +87,7 @@ ash::mojom::UpdateSeverity GetUpdateSeverity(UpgradeDetector* detector) { SystemTrayClient::SystemTrayClient() : binding_(this) { content::ServiceManagerConnection::GetForProcess() ->GetConnector() - ->BindInterface(ash_util::GetAshServiceName(), &system_tray_); + ->BindInterface(ash::mojom::kServiceName, &system_tray_); // Register this object as the client interface implementation. system_tray_->SetClient(binding_.CreateInterfacePtrAndBind()); diff --git a/chrome/browser/ui/ash/volume_controller.cc b/chrome/browser/ui/ash/volume_controller.cc index ea9eda2c1e5cc8..04dc8c8a663008 100644 --- a/chrome/browser/ui/ash/volume_controller.cc +++ b/chrome/browser/ui/ash/volume_controller.cc @@ -5,9 +5,9 @@ #include "chrome/browser/ui/ash/volume_controller.h" #include "ash/public/interfaces/accelerator_controller.mojom.h" +#include "ash/public/interfaces/constants.mojom.h" #include "base/command_line.h" #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" -#include "chrome/browser/ui/ash/ash_util.h" #include "chrome/grit/browser_resources.h" #include "chromeos/audio/chromeos_sounds.h" #include "chromeos/audio/cras_audio_handler.h" @@ -42,7 +42,7 @@ VolumeController::VolumeController() : binding_(this) { service_manager::Connector* connector = content::ServiceManagerConnection::GetForProcess()->GetConnector(); ash::mojom::AcceleratorControllerPtr accelerator_controller_ptr; - connector->BindInterface(ash_util::GetAshServiceName(), + connector->BindInterface(ash::mojom::kServiceName, &accelerator_controller_ptr); // Register this object as the volume controller. diff --git a/chrome/browser/ui/ash/vpn_list_forwarder.cc b/chrome/browser/ui/ash/vpn_list_forwarder.cc index d0559ec975ef35..8a4e968f7fbad5 100644 --- a/chrome/browser/ui/ash/vpn_list_forwarder.cc +++ b/chrome/browser/ui/ash/vpn_list_forwarder.cc @@ -4,6 +4,7 @@ #include "chrome/browser/ui/ash/vpn_list_forwarder.h" +#include "ash/public/interfaces/constants.mojom.h" #include "ash/public/interfaces/vpn_list.mojom.h" #include "base/bind.h" #include "base/location.h" @@ -12,7 +13,6 @@ #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/ash/ash_util.h" #include "components/user_manager/user.h" #include "components/user_manager/user_manager.h" #include "content/public/browser/notification_service.h" @@ -46,7 +46,7 @@ ash::mojom::VpnListPtr ConnectToVpnList() { ash::mojom::VpnListPtr vpn_list; content::ServiceManagerConnection::GetForProcess() ->GetConnector() - ->BindInterface(ash_util::GetAshServiceName(), &vpn_list); + ->BindInterface(ash::mojom::kServiceName, &vpn_list); return vpn_list; } diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc index 4427b04e1ff303..672800271879b4 100644 --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc @@ -12,6 +12,7 @@ #include "ash/common/session/session_state_delegate.h" #include "ash/common/system/chromeos/devicetype_utils.h" #include "ash/common/wm_shell.h" +#include "ash/public/interfaces/constants.mojom.h" #include "ash/shell.h" #include "ash/wm/lock_state_controller.h" #include "base/bind.h" @@ -62,7 +63,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_metrics.h" #include "chrome/browser/signin/easy_unlock_service.h" -#include "chrome/browser/ui/ash/ash_util.h" #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" @@ -336,7 +336,7 @@ SigninScreenHandler::SigninScreenHandler( content::ServiceManagerConnection::GetForProcess() ->GetConnector() - ->BindInterface(ash_util::GetAshServiceName(), &touch_view_manager_ptr_); + ->BindInterface(ash::mojom::kServiceName, &touch_view_manager_ptr_); touch_view_manager_ptr_->AddObserver( touch_view_binding_.CreateInterfacePtrAndBind()); } diff --git a/mash/package/mash_packaged_service.cc b/mash/package/mash_packaged_service.cc index 38d7f80013d563..ea219b2e5aef6e 100644 --- a/mash/package/mash_packaged_service.cc +++ b/mash/package/mash_packaged_service.cc @@ -26,6 +26,7 @@ #if defined(OS_CHROMEOS) #include "ash/autoclick/mus/autoclick_application.h" // nogncheck #include "ash/mus/window_manager_application.h" // nogncheck +#include "ash/public/interfaces/constants.mojom.h" // nogncheck #include "ash/touch_hud/mus/touch_hud_application.h" // nogncheck #endif @@ -84,7 +85,7 @@ std::unique_ptr MashPackagedService::CreateService( } #if defined(OS_CHROMEOS) - if (name == "ash") + if (name == ash::mojom::kServiceName) return base::WrapUnique(new ash::mus::WindowManagerApplication); if (name == "accessibility_autoclick") return base::WrapUnique(new ash::autoclick::AutoclickApplication);