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

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

Issue 2824943005: chromeos: Add org.chromium.NetworkProxyService D-Bus service. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | chromeos/dbus/services/proxy_resolution_service_provider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 DBusThreadManager::Initialize(process_mask); 235 DBusThreadManager::Initialize(process_mask);
236 236
237 bluez::BluezDBusManager::Initialize( 237 bluez::BluezDBusManager::Initialize(
238 DBusThreadManager::Get()->GetSystemBus(), 238 DBusThreadManager::Get()->GetSystemBus(),
239 chromeos::DBusThreadManager::Get()->IsUsingFakes()); 239 chromeos::DBusThreadManager::Get()->IsUsingFakes());
240 240
241 PowerPolicyController::Initialize( 241 PowerPolicyController::Initialize(
242 DBusThreadManager::Get()->GetPowerManagerClient()); 242 DBusThreadManager::Get()->GetPowerManagerClient());
243 243
244 CrosDBusService::ServiceProviderList service_providers; 244 CrosDBusService::ServiceProviderList service_providers;
245 // TODO(derat): Remove this provider once all callers are using
246 // |proxy_resolution_service_| instead: http://crbug.com/703217
245 service_providers.push_back( 247 service_providers.push_back(
246 base::MakeUnique<ProxyResolutionServiceProvider>( 248 base::MakeUnique<ProxyResolutionServiceProvider>(
249 kLibCrosServiceInterface, kResolveNetworkProxy,
247 base::MakeUnique<ChromeProxyResolutionServiceProviderDelegate>())); 250 base::MakeUnique<ChromeProxyResolutionServiceProviderDelegate>()));
248 if (GetAshConfig() == ash::Config::CLASSIC) { 251 if (GetAshConfig() == ash::Config::CLASSIC) {
249 // TODO(crbug.com/629707): revisit this with mustash dbus work. 252 // TODO(crbug.com/629707): revisit this with mustash dbus work.
250 service_providers.push_back(base::MakeUnique<DisplayPowerServiceProvider>( 253 service_providers.push_back(base::MakeUnique<DisplayPowerServiceProvider>(
251 base::MakeUnique<ChromeDisplayPowerServiceProviderDelegate>())); 254 base::MakeUnique<ChromeDisplayPowerServiceProviderDelegate>()));
252 } 255 }
253 service_providers.push_back(base::MakeUnique<LivenessServiceProvider>()); 256 service_providers.push_back(base::MakeUnique<LivenessServiceProvider>());
254 service_providers.push_back(base::MakeUnique<ScreenLockServiceProvider>()); 257 service_providers.push_back(base::MakeUnique<ScreenLockServiceProvider>());
255 if (GetAshConfig() == ash::Config::CLASSIC) { 258 if (GetAshConfig() == ash::Config::CLASSIC) {
256 service_providers.push_back(base::MakeUnique<ConsoleServiceProvider>( 259 service_providers.push_back(base::MakeUnique<ConsoleServiceProvider>(
257 base::MakeUnique<ChromeConsoleServiceProviderDelegate>())); 260 base::MakeUnique<ChromeConsoleServiceProviderDelegate>()));
258 } else { 261 } else {
259 service_providers.push_back(base::MakeUnique<ConsoleServiceProvider>( 262 service_providers.push_back(base::MakeUnique<ConsoleServiceProvider>(
260 base::MakeUnique<MusConsoleServiceProviderDelegate>())); 263 base::MakeUnique<MusConsoleServiceProviderDelegate>()));
261 } 264 }
265 // TODO(teravest): Remove this provider once all callers are using
266 // |kiosk_info_service_| instead: http://crbug.com/703229
262 service_providers.push_back(base::MakeUnique<KioskInfoService>( 267 service_providers.push_back(base::MakeUnique<KioskInfoService>(
263 kLibCrosServiceInterface, 268 kLibCrosServiceInterface,
264 kKioskAppServiceGetRequiredPlatformVersionMethod)); 269 kKioskAppServiceGetRequiredPlatformVersionMethod));
265 cros_dbus_service_ = CrosDBusService::Create( 270 cros_dbus_service_ = CrosDBusService::Create(
266 kLibCrosServiceName, dbus::ObjectPath(kLibCrosServicePath), 271 kLibCrosServiceName, dbus::ObjectPath(kLibCrosServicePath),
267 std::move(service_providers)); 272 std::move(service_providers));
268 273
274 proxy_resolution_service_ = CrosDBusService::Create(
275 kNetworkProxyServiceName, dbus::ObjectPath(kNetworkProxyServicePath),
276 CrosDBusService::CreateServiceProviderList(
277 base::MakeUnique<ProxyResolutionServiceProvider>(
278 kNetworkProxyServiceInterface,
279 kNetworkProxyServiceResolveProxyMethod,
280 base::MakeUnique<
281 ChromeProxyResolutionServiceProviderDelegate>())));
282
269 kiosk_info_service_ = CrosDBusService::Create( 283 kiosk_info_service_ = CrosDBusService::Create(
270 kKioskAppServiceName, dbus::ObjectPath(kKioskAppServicePath), 284 kKioskAppServiceName, dbus::ObjectPath(kKioskAppServicePath),
271 CrosDBusService::CreateServiceProviderList( 285 CrosDBusService::CreateServiceProviderList(
272 base::MakeUnique<KioskInfoService>( 286 base::MakeUnique<KioskInfoService>(
273 kKioskAppServiceInterface, 287 kKioskAppServiceInterface,
274 kKioskAppServiceGetRequiredPlatformVersionMethod))); 288 kKioskAppServiceGetRequiredPlatformVersionMethod)));
275 289
276 // Initialize PowerDataCollector after DBusThreadManager is initialized. 290 // Initialize PowerDataCollector after DBusThreadManager is initialized.
277 PowerDataCollector::Initialize(); 291 PowerDataCollector::Initialize();
278 292
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 network_connect_delegate_.reset(); 329 network_connect_delegate_.reset();
316 CertLibrary::Shutdown(); 330 CertLibrary::Shutdown();
317 NetworkHandler::Shutdown(); 331 NetworkHandler::Shutdown();
318 cryptohome::AsyncMethodCaller::Shutdown(); 332 cryptohome::AsyncMethodCaller::Shutdown();
319 disks::DiskMountManager::Shutdown(); 333 disks::DiskMountManager::Shutdown();
320 SystemSaltGetter::Shutdown(); 334 SystemSaltGetter::Shutdown();
321 LoginState::Shutdown(); 335 LoginState::Shutdown();
322 CertLoader::Shutdown(); 336 CertLoader::Shutdown();
323 TPMTokenLoader::Shutdown(); 337 TPMTokenLoader::Shutdown();
324 cros_dbus_service_.reset(); 338 cros_dbus_service_.reset();
339 proxy_resolution_service_.reset();
325 kiosk_info_service_.reset(); 340 kiosk_info_service_.reset();
326 PowerDataCollector::Shutdown(); 341 PowerDataCollector::Shutdown();
327 PowerPolicyController::Shutdown(); 342 PowerPolicyController::Shutdown();
328 device::BluetoothAdapterFactory::Shutdown(); 343 device::BluetoothAdapterFactory::Shutdown();
329 bluez::BluezDBusManager::Shutdown(); 344 bluez::BluezDBusManager::Shutdown();
330 345
331 // NOTE: This must only be called if Initialize() was called. 346 // NOTE: This must only be called if Initialize() was called.
332 DBusThreadManager::Shutdown(); 347 DBusThreadManager::Shutdown();
333 } 348 }
334 349
335 private: 350 private:
336 // Hosts providers for the "org.chromium.LibCrosService" D-Bus service owned 351 // Hosts providers for the "org.chromium.LibCrosService" D-Bus service owned
337 // by Chrome. The name of this service was chosen for historical reasons that 352 // by Chrome. The name of this service was chosen for historical reasons that
338 // are irrelevant now. 353 // are irrelevant now.
339 // TODO(derat): Move these providers into more-specific services that are 354 // TODO(derat): Move these providers into more-specific services that are
340 // split between different processes: http://crbug.com/692246 355 // split between different processes: http://crbug.com/692246
341 std::unique_ptr<CrosDBusService> cros_dbus_service_; 356 std::unique_ptr<CrosDBusService> cros_dbus_service_;
342 357
358 std::unique_ptr<CrosDBusService> proxy_resolution_service_;
343 std::unique_ptr<CrosDBusService> kiosk_info_service_; 359 std::unique_ptr<CrosDBusService> kiosk_info_service_;
344 360
345 std::unique_ptr<NetworkConnectDelegateChromeOS> network_connect_delegate_; 361 std::unique_ptr<NetworkConnectDelegateChromeOS> network_connect_delegate_;
346 362
347 DISALLOW_COPY_AND_ASSIGN(DBusServices); 363 DISALLOW_COPY_AND_ASSIGN(DBusServices);
348 }; 364 };
349 365
350 } // namespace internal 366 } // namespace internal
351 367
352 // ChromeBrowserMainPartsChromeos ---------------------------------------------- 368 // ChromeBrowserMainPartsChromeos ----------------------------------------------
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 996
981 ChromeBrowserMainPartsLinux::PostDestroyThreads(); 997 ChromeBrowserMainPartsLinux::PostDestroyThreads();
982 998
983 // Destroy DeviceSettingsService after g_browser_process. 999 // Destroy DeviceSettingsService after g_browser_process.
984 DeviceSettingsService::Shutdown(); 1000 DeviceSettingsService::Shutdown();
985 1001
986 chromeos::ShutdownCloseTracking(); 1002 chromeos::ShutdownCloseTracking();
987 } 1003 }
988 1004
989 } // namespace chromeos 1005 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chromeos/dbus/services/proxy_resolution_service_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698