| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/chromeos/chrome_browser_main_chromeos.h" | 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "chrome/browser/browser_process_platform_part_chromeos.h" | 29 #include "chrome/browser/browser_process_platform_part_chromeos.h" |
| 30 #include "chrome/browser/chrome_notification_types.h" | 30 #include "chrome/browser/chrome_notification_types.h" |
| 31 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 31 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 32 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 32 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| 33 #include "chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.h
" | 33 #include "chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.h
" |
| 34 #include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.h" | 34 #include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.h" |
| 35 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" | 35 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" |
| 36 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 36 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 37 #include "chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification
.h" | 37 #include "chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification
.h" |
| 38 #include "chrome/browser/chromeos/arc/arc_service_launcher.h" | 38 #include "chrome/browser/chromeos/arc/arc_service_launcher.h" |
| 39 #include "chrome/browser/chromeos/ash_config.h" |
| 39 #include "chrome/browser/chromeos/boot_times_recorder.h" | 40 #include "chrome/browser/chromeos/boot_times_recorder.h" |
| 40 #include "chrome/browser/chromeos/dbus/chrome_console_service_provider_delegate.
h" | 41 #include "chrome/browser/chromeos/dbus/chrome_console_service_provider_delegate.
h" |
| 41 #include "chrome/browser/chromeos/dbus/chrome_display_power_service_provider_del
egate.h" | 42 #include "chrome/browser/chromeos/dbus/chrome_display_power_service_provider_del
egate.h" |
| 42 #include "chrome/browser/chromeos/dbus/chrome_proxy_resolution_service_provider_
delegate.h" | 43 #include "chrome/browser/chromeos/dbus/chrome_proxy_resolution_service_provider_
delegate.h" |
| 43 #include "chrome/browser/chromeos/dbus/kiosk_info_service_provider.h" | 44 #include "chrome/browser/chromeos/dbus/kiosk_info_service_provider.h" |
| 44 #include "chrome/browser/chromeos/dbus/mus_console_service_provider_delegate.h" | 45 #include "chrome/browser/chromeos/dbus/mus_console_service_provider_delegate.h" |
| 45 #include "chrome/browser/chromeos/dbus/screen_lock_service_provider.h" | 46 #include "chrome/browser/chromeos/dbus/screen_lock_service_provider.h" |
| 46 #include "chrome/browser/chromeos/display/quirks_manager_delegate_impl.h" | 47 #include "chrome/browser/chromeos/display/quirks_manager_delegate_impl.h" |
| 47 #include "chrome/browser/chromeos/events/event_rewriter_controller.h" | 48 #include "chrome/browser/chromeos/events/event_rewriter_controller.h" |
| 48 #include "chrome/browser/chromeos/events/event_rewriter_delegate_impl.h" | 49 #include "chrome/browser/chromeos/events/event_rewriter_delegate_impl.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 209 |
| 209 namespace internal { | 210 namespace internal { |
| 210 | 211 |
| 211 // Wrapper class for initializing dbus related services and shutting them | 212 // Wrapper class for initializing dbus related services and shutting them |
| 212 // down. This gets instantiated in a scoped_ptr so that shutdown methods in the | 213 // down. This gets instantiated in a scoped_ptr so that shutdown methods in the |
| 213 // destructor will get called if and only if this has been instantiated. | 214 // destructor will get called if and only if this has been instantiated. |
| 214 class DBusServices { | 215 class DBusServices { |
| 215 public: | 216 public: |
| 216 explicit DBusServices(const content::MainFunctionParams& parameters) { | 217 explicit DBusServices(const content::MainFunctionParams& parameters) { |
| 217 // Under mash, some D-Bus clients are owned by other processes. | 218 // Under mash, some D-Bus clients are owned by other processes. |
| 218 DBusThreadManager::ProcessMask process_mask = | 219 DBusThreadManager::ProcessMask process_mask; |
| 219 ash_util::IsRunningInMash() ? DBusThreadManager::PROCESS_BROWSER | 220 switch (GetAshConfig()) { |
| 220 : DBusThreadManager::PROCESS_ALL; | 221 case ash::Config::CLASSIC: |
| 222 process_mask = DBusThreadManager::PROCESS_ALL; |
| 223 break; |
| 224 case ash::Config::MUS: |
| 225 // TODO(jamescook|derat): We need another category for mushrome. |
| 226 process_mask = DBusThreadManager::PROCESS_ALL; |
| 227 break; |
| 228 case ash::Config::MASH: |
| 229 process_mask = DBusThreadManager::PROCESS_BROWSER; |
| 230 break; |
| 231 } |
| 221 | 232 |
| 222 // Initialize DBusThreadManager for the browser. This must be done after | 233 // Initialize DBusThreadManager for the browser. This must be done after |
| 223 // the main message loop is started, as it uses the message loop. | 234 // the main message loop is started, as it uses the message loop. |
| 224 DBusThreadManager::Initialize(process_mask); | 235 DBusThreadManager::Initialize(process_mask); |
| 225 | 236 |
| 226 bluez::BluezDBusManager::Initialize( | 237 bluez::BluezDBusManager::Initialize( |
| 227 DBusThreadManager::Get()->GetSystemBus(), | 238 DBusThreadManager::Get()->GetSystemBus(), |
| 228 chromeos::DBusThreadManager::Get()->IsUsingFakes()); | 239 chromeos::DBusThreadManager::Get()->IsUsingFakes()); |
| 229 | 240 |
| 230 PowerPolicyController::Initialize( | 241 PowerPolicyController::Initialize( |
| 231 DBusThreadManager::Get()->GetPowerManagerClient()); | 242 DBusThreadManager::Get()->GetPowerManagerClient()); |
| 232 | 243 |
| 233 CrosDBusService::ServiceProviderList service_providers; | 244 CrosDBusService::ServiceProviderList service_providers; |
| 234 service_providers.push_back( | 245 service_providers.push_back( |
| 235 base::MakeUnique<ProxyResolutionServiceProvider>( | 246 base::MakeUnique<ProxyResolutionServiceProvider>( |
| 236 base::MakeUnique<ChromeProxyResolutionServiceProviderDelegate>())); | 247 base::MakeUnique<ChromeProxyResolutionServiceProviderDelegate>())); |
| 237 if (!ash_util::IsRunningInMash()) { | 248 if (GetAshConfig() == ash::Config::CLASSIC) { |
| 238 // TODO(crbug.com/629707): revisit this with mustash dbus work. | 249 // TODO(crbug.com/629707): revisit this with mustash dbus work. |
| 239 service_providers.push_back(base::MakeUnique<DisplayPowerServiceProvider>( | 250 service_providers.push_back(base::MakeUnique<DisplayPowerServiceProvider>( |
| 240 base::MakeUnique<ChromeDisplayPowerServiceProviderDelegate>())); | 251 base::MakeUnique<ChromeDisplayPowerServiceProviderDelegate>())); |
| 241 } | 252 } |
| 242 service_providers.push_back(base::MakeUnique<LivenessServiceProvider>()); | 253 service_providers.push_back(base::MakeUnique<LivenessServiceProvider>()); |
| 243 service_providers.push_back(base::MakeUnique<ScreenLockServiceProvider>()); | 254 service_providers.push_back(base::MakeUnique<ScreenLockServiceProvider>()); |
| 244 if (ash_util::IsRunningInMash()) { | 255 if (GetAshConfig() == ash::Config::CLASSIC) { |
| 256 service_providers.push_back(base::MakeUnique<ConsoleServiceProvider>( |
| 257 base::MakeUnique<ChromeConsoleServiceProviderDelegate>())); |
| 258 } else { |
| 245 service_providers.push_back(base::MakeUnique<ConsoleServiceProvider>( | 259 service_providers.push_back(base::MakeUnique<ConsoleServiceProvider>( |
| 246 base::MakeUnique<MusConsoleServiceProviderDelegate>())); | 260 base::MakeUnique<MusConsoleServiceProviderDelegate>())); |
| 247 } else { | |
| 248 service_providers.push_back(base::MakeUnique<ConsoleServiceProvider>( | |
| 249 base::MakeUnique<ChromeConsoleServiceProviderDelegate>())); | |
| 250 } | 261 } |
| 251 service_providers.push_back(base::MakeUnique<KioskInfoService>( | 262 service_providers.push_back(base::MakeUnique<KioskInfoService>( |
| 252 kLibCrosServiceInterface, | 263 kLibCrosServiceInterface, |
| 253 kKioskAppServiceGetRequiredPlatformVersionMethod)); | 264 kKioskAppServiceGetRequiredPlatformVersionMethod)); |
| 254 cros_dbus_service_ = CrosDBusService::Create( | 265 cros_dbus_service_ = CrosDBusService::Create( |
| 255 kLibCrosServiceName, dbus::ObjectPath(kLibCrosServicePath), | 266 kLibCrosServiceName, dbus::ObjectPath(kLibCrosServicePath), |
| 256 std::move(service_providers)); | 267 std::move(service_providers)); |
| 257 | 268 |
| 258 kiosk_info_service_ = CrosDBusService::Create( | 269 kiosk_info_service_ = CrosDBusService::Create( |
| 259 kKioskAppServiceName, dbus::ObjectPath(kKioskAppServicePath), | 270 kKioskAppServiceName, dbus::ObjectPath(kKioskAppServicePath), |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 | 980 |
| 970 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 981 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 971 | 982 |
| 972 // Destroy DeviceSettingsService after g_browser_process. | 983 // Destroy DeviceSettingsService after g_browser_process. |
| 973 DeviceSettingsService::Shutdown(); | 984 DeviceSettingsService::Shutdown(); |
| 974 | 985 |
| 975 chromeos::ShutdownCloseTracking(); | 986 chromeos::ShutdownCloseTracking(); |
| 976 } | 987 } |
| 977 | 988 |
| 978 } // namespace chromeos | 989 } // namespace chromeos |
| OLD | NEW |