Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 1347193004: Refactor DBusThreadManager to split away BT clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 #include "components/metrics/metrics_service.h" 111 #include "components/metrics/metrics_service.h"
112 #include "components/ownership/owner_key_util.h" 112 #include "components/ownership/owner_key_util.h"
113 #include "components/session_manager/core/session_manager.h" 113 #include "components/session_manager/core/session_manager.h"
114 #include "components/user_manager/user.h" 114 #include "components/user_manager/user.h"
115 #include "components/user_manager/user_manager.h" 115 #include "components/user_manager/user_manager.h"
116 #include "components/wallpaper/wallpaper_manager_base.h" 116 #include "components/wallpaper/wallpaper_manager_base.h"
117 #include "content/public/browser/browser_thread.h" 117 #include "content/public/browser/browser_thread.h"
118 #include "content/public/browser/notification_service.h" 118 #include "content/public/browser/notification_service.h"
119 #include "content/public/common/main_function_params.h" 119 #include "content/public/common/main_function_params.h"
120 #include "device/bluetooth/bluetooth_adapter_factory.h" 120 #include "device/bluetooth/bluetooth_adapter_factory.h"
121 #include "device/bluetooth/dbus/bluez_dbus_manager.h"
121 #include "media/audio/sounds/sounds_manager.h" 122 #include "media/audio/sounds/sounds_manager.h"
122 #include "net/base/network_change_notifier.h" 123 #include "net/base/network_change_notifier.h"
123 #include "net/socket/ssl_server_socket.h" 124 #include "net/socket/ssl_server_socket.h"
124 #include "net/url_request/url_request.h" 125 #include "net/url_request/url_request.h"
125 #include "net/url_request/url_request_context_getter.h" 126 #include "net/url_request/url_request_context_getter.h"
126 #include "ui/base/ime/chromeos/ime_keyboard.h" 127 #include "ui/base/ime/chromeos/ime_keyboard.h"
127 #include "ui/base/ime/chromeos/input_method_manager.h" 128 #include "ui/base/ime/chromeos/input_method_manager.h"
128 #include "ui/base/touch/touch_device.h" 129 #include "ui/base/touch/touch_device.h"
129 #include "ui/events/event_utils.h" 130 #include "ui/events/event_utils.h"
130 131
(...skipping 30 matching lines...) Expand all
161 162
162 // Wrapper class for initializing dbus related services and shutting them 163 // Wrapper class for initializing dbus related services and shutting them
163 // down. This gets instantiated in a scoped_ptr so that shutdown methods in the 164 // down. This gets instantiated in a scoped_ptr so that shutdown methods in the
164 // destructor will get called if and only if this has been instantiated. 165 // destructor will get called if and only if this has been instantiated.
165 class DBusServices { 166 class DBusServices {
166 public: 167 public:
167 explicit DBusServices(const content::MainFunctionParams& parameters) { 168 explicit DBusServices(const content::MainFunctionParams& parameters) {
168 // Initialize DBusThreadManager for the browser. This must be done after 169 // Initialize DBusThreadManager for the browser. This must be done after
169 // the main message loop is started, as it uses the message loop. 170 // the main message loop is started, as it uses the message loop.
170 DBusThreadManager::Initialize(); 171 DBusThreadManager::Initialize();
172
173 bluez::BluezDBusManager::Initialize(
174 DBusThreadManager::Get()->GetSystemBus(),
175 chromeos::DBusThreadManager::Get()->IsUsingStub(
176 chromeos::DBusClientBundle::BLUETOOTH));
177
171 PowerPolicyController::Initialize( 178 PowerPolicyController::Initialize(
172 DBusThreadManager::Get()->GetPowerManagerClient()); 179 DBusThreadManager::Get()->GetPowerManagerClient());
173 180
174 ScopedVector<CrosDBusService::ServiceProviderInterface> service_providers; 181 ScopedVector<CrosDBusService::ServiceProviderInterface> service_providers;
175 service_providers.push_back(ProxyResolutionServiceProvider::Create( 182 service_providers.push_back(ProxyResolutionServiceProvider::Create(
176 make_scoped_ptr(new ChromeProxyResolverDelegate()))); 183 make_scoped_ptr(new ChromeProxyResolverDelegate())));
177 service_providers.push_back(new DisplayPowerServiceProvider( 184 service_providers.push_back(new DisplayPowerServiceProvider(
178 make_scoped_ptr(new ChromeDisplayPowerServiceProviderDelegate))); 185 make_scoped_ptr(new ChromeDisplayPowerServiceProviderDelegate)));
179 service_providers.push_back(new LivenessServiceProvider); 186 service_providers.push_back(new LivenessServiceProvider);
180 service_providers.push_back(new ScreenLockServiceProvider); 187 service_providers.push_back(new ScreenLockServiceProvider);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 cryptohome::AsyncMethodCaller::Shutdown(); 234 cryptohome::AsyncMethodCaller::Shutdown();
228 disks::DiskMountManager::Shutdown(); 235 disks::DiskMountManager::Shutdown();
229 SystemSaltGetter::Shutdown(); 236 SystemSaltGetter::Shutdown();
230 LoginState::Shutdown(); 237 LoginState::Shutdown();
231 CertLoader::Shutdown(); 238 CertLoader::Shutdown();
232 TPMTokenLoader::Shutdown(); 239 TPMTokenLoader::Shutdown();
233 CrosDBusService::Shutdown(); 240 CrosDBusService::Shutdown();
234 PowerDataCollector::Shutdown(); 241 PowerDataCollector::Shutdown();
235 PowerPolicyController::Shutdown(); 242 PowerPolicyController::Shutdown();
236 device::BluetoothAdapterFactory::Shutdown(); 243 device::BluetoothAdapterFactory::Shutdown();
244 bluez::BluezDBusManager::Shutdown();
237 245
238 // NOTE: This must only be called if Initialize() was called. 246 // NOTE: This must only be called if Initialize() was called.
239 DBusThreadManager::Shutdown(); 247 DBusThreadManager::Shutdown();
240 } 248 }
241 249
242 private: 250 private:
243 scoped_ptr<NetworkConnectDelegateChromeOS> network_connect_delegate_; 251 scoped_ptr<NetworkConnectDelegateChromeOS> network_connect_delegate_;
244 252
245 DISALLOW_COPY_AND_ASSIGN(DBusServices); 253 DISALLOW_COPY_AND_ASSIGN(DBusServices);
246 }; 254 };
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 // Destroy DBus services immediately after threads are stopped. 780 // Destroy DBus services immediately after threads are stopped.
773 dbus_services_.reset(); 781 dbus_services_.reset();
774 782
775 ChromeBrowserMainPartsLinux::PostDestroyThreads(); 783 ChromeBrowserMainPartsLinux::PostDestroyThreads();
776 784
777 // Destroy DeviceSettingsService after g_browser_process. 785 // Destroy DeviceSettingsService after g_browser_process.
778 DeviceSettingsService::Shutdown(); 786 DeviceSettingsService::Shutdown();
779 } 787 }
780 788
781 } // namespace chromeos 789 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698