Chromium Code Reviews| Index: chrome/browser/policy/chrome_browser_policy_connector.cc |
| diff --git a/chrome/browser/policy/chrome_browser_policy_connector.cc b/chrome/browser/policy/chrome_browser_policy_connector.cc |
| index 54223b5d8dcf2c95ee1e17c8b83702ce6aea3ceb..29a3dde028eb40a219d52d1d54017ca1549653a5 100644 |
| --- a/chrome/browser/policy/chrome_browser_policy_connector.cc |
| +++ b/chrome/browser/policy/chrome_browser_policy_connector.cc |
| @@ -79,11 +79,13 @@ base::FilePath GetManagedPolicyPath() { |
| class DeviceManagementServiceConfiguration |
| : public DeviceManagementService::Configuration { |
| public: |
| - DeviceManagementServiceConfiguration() {} |
| + DeviceManagementServiceConfiguration( |
|
bartfab (slow)
2014/04/23 12:17:18
Nit: explicit.
davidyu
2014/04/23 12:56:58
Done.
|
| + BrowserPolicyConnector::ManagementMode management_mode) |
| + : management_mode_(management_mode) {} |
| virtual ~DeviceManagementServiceConfiguration() {} |
| virtual std::string GetServerUrl() OVERRIDE { |
| - return BrowserPolicyConnector::GetDeviceManagementUrl(); |
| + return BrowserPolicyConnector::GetDeviceManagementUrl(management_mode_); |
| } |
| virtual std::string GetAgentParameter() OVERRIDE { |
| @@ -128,6 +130,9 @@ class DeviceManagementServiceConfiguration |
| return base::StringPrintf( |
| "%s|%s|%s", os_name.c_str(), os_hardware.c_str(), os_version.c_str()); |
| } |
| + |
| + private: |
| + BrowserPolicyConnector::ManagementMode management_mode_; |
| }; |
| } // namespace |
| @@ -148,15 +153,18 @@ void ChromeBrowserPolicyConnector::Init( |
| // sure that threading is ready at this point. |
| DCHECK(BrowserThread::IsThreadInitialized(BrowserThread::FILE)); |
| - scoped_ptr<DeviceManagementService::Configuration> configuration( |
| - new DeviceManagementServiceConfiguration); |
| - scoped_ptr<DeviceManagementService> device_management_service( |
| - new DeviceManagementService(configuration.Pass())); |
| - device_management_service->ScheduleInitialization( |
| - kServiceInitializationStartupDelay); |
| + ScopedVector<DeviceManagementService> services; |
|
bartfab (slow)
2014/04/23 12:17:18
Nit: #include "base/memory/scoped_vector.h"
davidyu
2014/04/23 12:56:58
ScopedVector<> removed.
|
| + for (int i = 0; i < NUM_MANAGEMENT_MODES; ++i) { |
| + scoped_ptr<DeviceManagementService::Configuration> configuration( |
| + new DeviceManagementServiceConfiguration( |
| + static_cast<ManagementMode>(i))); |
| + services.push_back( |
| + new DeviceManagementService(configuration.Pass())); |
| + services.back()->ScheduleInitialization( |
| + kServiceInitializationStartupDelay); |
| + } |
| - BrowserPolicyConnector::Init( |
| - local_state, request_context, device_management_service.Pass()); |
| + BrowserPolicyConnector::Init(local_state, request_context, services.Pass()); |
| } |
| ConfigurationPolicyProvider* |