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

Unified Diff: chrome/browser/policy/browser_policy_connector.h

Issue 8586030: Added ConfigurationPolicyProvider::RefreshPolicies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed LoginUtilsTest Created 9 years, 1 month 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/browser_policy_connector.h
diff --git a/chrome/browser/policy/browser_policy_connector.h b/chrome/browser/policy/browser_policy_connector.h
index 2dbd1b4612311085f12b545528d268cd49cbe371..50d4462ff6751d1d0bcdeb4f4040395824be869f 100644
--- a/chrome/browser/policy/browser_policy_connector.h
+++ b/chrome/browser/policy/browser_policy_connector.h
@@ -40,9 +40,16 @@ class BrowserPolicyConnector : public content::NotificationObserver {
TOKEN_TYPE_OAUTH, // An OAuth v2 access token.
};
- static BrowserPolicyConnector* Create();
+ // Builds an uninitialized BrowserPolicyConnector, suitable for testing.
+ // Init() should be called to create and start the policy machinery.
+ BrowserPolicyConnector();
virtual ~BrowserPolicyConnector();
+ // Creates the policy providers and finalizes the initialization of the
+ // connector. This call can be skipped on tests that don't require the full
+ // policy system running.
+ void Init();
+
ConfigurationPolicyProvider* GetManagedPlatformProvider() const;
ConfigurationPolicyProvider* GetManagedCloudProvider() const;
ConfigurationPolicyProvider* GetRecommendedPlatformProvider() const;
@@ -86,12 +93,12 @@ class BrowserPolicyConnector : public content::NotificationObserver {
// and clears the error flags, so potential retries have a chance to succeed.
void ResetDevicePolicy();
- // Initiates a policy fetch after a successful device registration.
- void FetchDevicePolicy();
+ // Initiates device and user policy fetches, if possible. Pending fetches
+ // will be cancelled.
+ void FetchCloudPolicy();
- // Initiates a user policy fetch after a successful device registration. This
- // is only safe to call when a user device token is available.
- void FetchUserPolicy();
+ // Refreshes policies on each existing provider.
+ void RefreshPolicies();
// Schedules initialization of the cloud policy backend services, if the
// services are already constructed.
@@ -124,18 +131,6 @@ class BrowserPolicyConnector : public content::NotificationObserver {
const std::string& user_name);
private:
- friend class ::TestingBrowserProcess;
-
- BrowserPolicyConnector();
-
- // Constructor for tests that allows tests to use fake platform and cloud
- // policy providers instead of using the actual ones.
- BrowserPolicyConnector(
- ConfigurationPolicyProvider* managed_platform_provider,
- ConfigurationPolicyProvider* recommended_platform_provider,
- CloudPolicyProvider* managed_cloud_provider,
- CloudPolicyProvider* recommended_cloud_provider);
-
// content::NotificationObserver method overrides:
virtual void Observe(int type,
const content::NotificationSource& source,
@@ -149,7 +144,6 @@ class BrowserPolicyConnector : public content::NotificationObserver {
// be running.
void InitializeDevicePolicySubsystem();
- static BrowserPolicyConnector* CreateForTests();
static ConfigurationPolicyProvider* CreateManagedPlatformProvider();
static ConfigurationPolicyProvider* CreateRecommendedPlatformProvider();

Powered by Google App Engine
This is Rietveld 408576698