| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 #include "chrome/common/pref_names.h" | 94 #include "chrome/common/pref_names.h" |
| 95 #include "chromeos/audio/audio_devices_pref_handler_impl.h" | 95 #include "chromeos/audio/audio_devices_pref_handler_impl.h" |
| 96 #include "chromeos/audio/cras_audio_handler.h" | 96 #include "chromeos/audio/cras_audio_handler.h" |
| 97 #include "chromeos/cert_loader.h" | 97 #include "chromeos/cert_loader.h" |
| 98 #include "chromeos/chromeos_paths.h" | 98 #include "chromeos/chromeos_paths.h" |
| 99 #include "chromeos/chromeos_switches.h" | 99 #include "chromeos/chromeos_switches.h" |
| 100 #include "chromeos/cryptohome/async_method_caller.h" | 100 #include "chromeos/cryptohome/async_method_caller.h" |
| 101 #include "chromeos/cryptohome/cryptohome_parameters.h" | 101 #include "chromeos/cryptohome/cryptohome_parameters.h" |
| 102 #include "chromeos/cryptohome/homedir_methods.h" | 102 #include "chromeos/cryptohome/homedir_methods.h" |
| 103 #include "chromeos/cryptohome/system_salt_getter.h" | 103 #include "chromeos/cryptohome/system_salt_getter.h" |
| 104 #include "chromeos/dbus/dbus_client_bundle.h" |
| 104 #include "chromeos/dbus/dbus_thread_manager.h" | 105 #include "chromeos/dbus/dbus_thread_manager.h" |
| 105 #include "chromeos/dbus/power_policy_controller.h" | 106 #include "chromeos/dbus/power_policy_controller.h" |
| 106 #include "chromeos/dbus/services/console_service_provider.h" | 107 #include "chromeos/dbus/services/console_service_provider.h" |
| 107 #include "chromeos/dbus/services/cros_dbus_service.h" | 108 #include "chromeos/dbus/services/cros_dbus_service.h" |
| 108 #include "chromeos/dbus/services/display_power_service_provider.h" | 109 #include "chromeos/dbus/services/display_power_service_provider.h" |
| 109 #include "chromeos/dbus/services/liveness_service_provider.h" | 110 #include "chromeos/dbus/services/liveness_service_provider.h" |
| 110 #include "chromeos/dbus/services/proxy_resolution_service_provider.h" | 111 #include "chromeos/dbus/services/proxy_resolution_service_provider.h" |
| 111 #include "chromeos/dbus/session_manager_client.h" | 112 #include "chromeos/dbus/session_manager_client.h" |
| 112 #include "chromeos/disks/disk_mount_manager.h" | 113 #include "chromeos/disks/disk_mount_manager.h" |
| 113 #include "chromeos/login/login_state.h" | 114 #include "chromeos/login/login_state.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 } // namespace | 192 } // namespace |
| 192 | 193 |
| 193 namespace internal { | 194 namespace internal { |
| 194 | 195 |
| 195 // Wrapper class for initializing dbus related services and shutting them | 196 // Wrapper class for initializing dbus related services and shutting them |
| 196 // down. This gets instantiated in a scoped_ptr so that shutdown methods in the | 197 // down. This gets instantiated in a scoped_ptr so that shutdown methods in the |
| 197 // destructor will get called if and only if this has been instantiated. | 198 // destructor will get called if and only if this has been instantiated. |
| 198 class DBusServices { | 199 class DBusServices { |
| 199 public: | 200 public: |
| 200 explicit DBusServices(const content::MainFunctionParams& parameters) { | 201 explicit DBusServices(const content::MainFunctionParams& parameters) { |
| 202 DBusClientTypeMask dbus_clients = DBusClientBundle::ALL_CLIENTS; |
| 203 // Under mustash the ash process handles SMS D-Bus services. |
| 204 if (chrome::IsRunningInMash()) { |
| 205 dbus_clients &= ~DBusClientBundle::GSM_SMS; |
| 206 dbus_clients &= ~DBusClientBundle::SMS; |
| 207 } |
| 201 // Initialize DBusThreadManager for the browser. This must be done after | 208 // Initialize DBusThreadManager for the browser. This must be done after |
| 202 // the main message loop is started, as it uses the message loop. | 209 // the main message loop is started, as it uses the message loop. |
| 203 DBusThreadManager::Initialize(); | 210 DBusThreadManager::Initialize(dbus_clients); |
| 204 | 211 |
| 205 bluez::BluezDBusManager::Initialize( | 212 bluez::BluezDBusManager::Initialize( |
| 206 DBusThreadManager::Get()->GetSystemBus(), | 213 DBusThreadManager::Get()->GetSystemBus(), |
| 207 chromeos::DBusThreadManager::Get()->IsUsingStub( | 214 chromeos::DBusThreadManager::Get()->IsUsingFake( |
| 208 chromeos::DBusClientBundle::BLUETOOTH)); | 215 chromeos::DBusClientBundle::BLUETOOTH)); |
| 209 | 216 |
| 210 PowerPolicyController::Initialize( | 217 PowerPolicyController::Initialize( |
| 211 DBusThreadManager::Get()->GetPowerManagerClient()); | 218 DBusThreadManager::Get()->GetPowerManagerClient()); |
| 212 | 219 |
| 213 CrosDBusService::ServiceProviderList service_providers; | 220 CrosDBusService::ServiceProviderList service_providers; |
| 214 service_providers.push_back( | 221 service_providers.push_back( |
| 215 base::WrapUnique(ProxyResolutionServiceProvider::Create( | 222 base::WrapUnique(ProxyResolutionServiceProvider::Create( |
| 216 base::MakeUnique<ChromeProxyResolverDelegate>()))); | 223 base::MakeUnique<ChromeProxyResolverDelegate>()))); |
| 217 if (!chrome::IsRunningInMash()) { | 224 if (!chrome::IsRunningInMash()) { |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 // Destroy DBus services immediately after threads are stopped. | 885 // Destroy DBus services immediately after threads are stopped. |
| 879 dbus_services_.reset(); | 886 dbus_services_.reset(); |
| 880 | 887 |
| 881 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 888 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 882 | 889 |
| 883 // Destroy DeviceSettingsService after g_browser_process. | 890 // Destroy DeviceSettingsService after g_browser_process. |
| 884 DeviceSettingsService::Shutdown(); | 891 DeviceSettingsService::Shutdown(); |
| 885 } | 892 } |
| 886 | 893 |
| 887 } // namespace chromeos | 894 } // namespace chromeos |
| OLD | NEW |