Index: components/policy/core/browser/browser_policy_connector.h |
diff --git a/components/policy/core/browser/browser_policy_connector.h b/components/policy/core/browser/browser_policy_connector.h |
index 2c4307d3f711259ac557d154a1ba59a60f3b9a3f..e22a4f4b01bcd4690a414e485d5e7c52d1a97e47 100644 |
--- a/components/policy/core/browser/browser_policy_connector.h |
+++ b/components/policy/core/browser/browser_policy_connector.h |
@@ -36,6 +36,12 @@ class PolicyStatisticsCollector; |
// subclasses. |
class POLICY_EXPORT BrowserPolicyConnector { |
public: |
+ enum ManagementMode { |
+ NOT_MANAGED, |
+ ENTERPRISE_MANAGED, |
+ CONSUMER_MANAGED |
+ }; |
+ |
// Invoke Shutdown() before deleting, see below. |
virtual ~BrowserPolicyConnector(); |
@@ -75,10 +81,17 @@ class POLICY_EXPORT BrowserPolicyConnector { |
const ConfigurationPolicyHandlerList* GetHandlerList() const; |
+ // TODO(davidyu): migrate all callers to use GetDeviceManagementService() |
+ // instead. http://crbug.com/366085. |
DeviceManagementService* device_management_service() { |
- return device_management_service_.get(); |
+ return GetDeviceManagementService(ENTERPRISE_MANAGED); |
} |
+ // Returns the device management service based on the management mode. |
+ // |management_mode| must not be NOT_MANAGED. |
+ DeviceManagementService* GetDeviceManagementService( |
+ ManagementMode management_mode); |
+ |
// Sets a |provider| that will be included in PolicyServices returned by |
// GetPolicyService. This is a static method because local state is |
// created immediately after the connector, and tests don't have a chance to |
@@ -94,7 +107,8 @@ class POLICY_EXPORT BrowserPolicyConnector { |
static bool IsNonEnterpriseUser(const std::string& username); |
// Returns the URL for the device management service endpoint. |
- static std::string GetDeviceManagementUrl(); |
+ // |management_mode| must not be NOT_MANAGED. |
+ static std::string GetDeviceManagementUrl(ManagementMode management_mode); |
// Registers refresh rate prefs. |
static void RegisterPrefs(PrefRegistrySimple* registry); |
@@ -108,7 +122,10 @@ class POLICY_EXPORT BrowserPolicyConnector { |
// Helper for the public Init() that must be called by subclasses. |
void Init(PrefService* local_state, |
scoped_refptr<net::URLRequestContextGetter> request_context, |
- scoped_ptr<DeviceManagementService> device_management_service); |
+ scoped_ptr<DeviceManagementService> |
+ enterprise_device_management_services, |
+ scoped_ptr<DeviceManagementService> |
+ consumer_device_management_services); |
// Adds |provider| to the list of |policy_providers_|. Providers should |
// be added in decreasing order of priority. |
@@ -146,7 +163,8 @@ class POLICY_EXPORT BrowserPolicyConnector { |
scoped_ptr<PolicyStatisticsCollector> policy_statistics_collector_; |
- scoped_ptr<DeviceManagementService> device_management_service_; |
+ scoped_ptr<DeviceManagementService> enterprise_device_management_service_; |
+ scoped_ptr<DeviceManagementService> consumer_device_management_service_; |
DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector); |
}; |