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

Unified Diff: chrome/browser/policy/chrome_browser_policy_connector.cc

Issue 240903002: Add consumer_device_management_service() in BrowserPolicyConnectorChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
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..75c02c5e2e64fa8a16bca56e7d650ec8e94d014e 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() {}
+ explicit DeviceManagementServiceConfiguration(
Mattias Nissler (ping if slow) 2014/04/23 14:32:39 Note that this file is the cross-platform BrowserP
davidyu 2014/04/23 15:22:50 I don't think we will make this feature available
Mattias Nissler (ping if slow) 2014/04/23 15:25:18 Yes, everything related to consumer management sho
davidyu 2014/04/24 04:52:41 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,24 @@ 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(
+ scoped_ptr<DeviceManagementService::Configuration> enterprise_configuration(
+ new DeviceManagementServiceConfiguration(ENTERPRISE_MANAGED));
+ scoped_ptr<DeviceManagementService> enterprise_service(
+ new DeviceManagementService(enterprise_configuration.Pass()));
+ enterprise_service->ScheduleInitialization(
+ kServiceInitializationStartupDelay);
+
+ scoped_ptr<DeviceManagementService::Configuration> consumer_configuration(
+ new DeviceManagementServiceConfiguration(CONSUMER_MANAGED));
+ scoped_ptr<DeviceManagementService> consumer_service(
+ new DeviceManagementService(consumer_configuration.Pass()));
+ consumer_service->ScheduleInitialization(
kServiceInitializationStartupDelay);
- BrowserPolicyConnector::Init(
- local_state, request_context, device_management_service.Pass());
+ BrowserPolicyConnector::Init(local_state,
+ request_context,
+ enterprise_service.Pass(),
+ consumer_service.Pass());
}
ConfigurationPolicyProvider*
« no previous file with comments | « chrome/browser/chromeos/login/chrome_restart_request.cc ('k') | components/policy/core/browser/browser_policy_connector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698