Chromium Code Reviews| 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..c380d1e72f8753128c2349f184d6643bec72809a 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 { |
| + ENTERPRISE_MANAGED = 0, |
| + CONSUMER_MANAGED, |
| + NUM_MANAGEMENT_MODES // This should always be the last line. |
| + }; |
| + |
| // Invoke Shutdown() before deleting, see below. |
| virtual ~BrowserPolicyConnector(); |
| @@ -75,10 +81,15 @@ class POLICY_EXPORT BrowserPolicyConnector { |
| const ConfigurationPolicyHandlerList* GetHandlerList() const; |
| + // DEPRECATED: use GetDeviceManagementService() instead. |
|
bartfab (slow)
2014/04/23 12:17:18
Nit: Add a TODO and a bug number to have all curre
davidyu
2014/04/23 12:56:58
Done.
|
| DeviceManagementService* device_management_service() { |
| - return device_management_service_.get(); |
| + return GetDeviceManagementService(ENTERPRISE_MANAGED); |
| } |
| + // Returns the device management service based on the management mode. |
| + 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 +105,7 @@ class POLICY_EXPORT BrowserPolicyConnector { |
| static bool IsNonEnterpriseUser(const std::string& username); |
| // Returns the URL for the device management service endpoint. |
| - static std::string GetDeviceManagementUrl(); |
| + static std::string GetDeviceManagementUrl(ManagementMode management_mode); |
| // Registers refresh rate prefs. |
| static void RegisterPrefs(PrefRegistrySimple* registry); |
| @@ -108,7 +119,7 @@ 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); |
| + ScopedVector<DeviceManagementService> device_management_services); |
| // Adds |provider| to the list of |policy_providers_|. Providers should |
| // be added in decreasing order of priority. |
| @@ -146,7 +157,7 @@ class POLICY_EXPORT BrowserPolicyConnector { |
| scoped_ptr<PolicyStatisticsCollector> policy_statistics_collector_; |
| - scoped_ptr<DeviceManagementService> device_management_service_; |
| + ScopedVector<DeviceManagementService> device_management_services_; |
| DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector); |
| }; |