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

Unified Diff: components/policy/core/browser/browser_policy_connector.h

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: 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);
};

Powered by Google App Engine
This is Rietveld 408576698