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

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

Issue 8499021: UserPolicyCache only becomes ready after policy has been fetched. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased 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 da746b58ef0766056e04366abdba1f341010d0f8..2dbd1b4612311085f12b545528d268cd49cbe371 100644
--- a/chrome/browser/policy/browser_policy_connector.h
+++ b/chrome/browser/policy/browser_policy_connector.h
@@ -98,13 +98,19 @@ class BrowserPolicyConnector : public content::NotificationObserver {
void ScheduleServiceInitialization(int64 delay_milliseconds);
// Initializes the user cloud policy infrastructure.
- void InitializeUserPolicy(const std::string& user_name);
+ // If |wait_for_policy_fetch| is true, the user policy will only become fully
+ // initialized after a policy fetch is attempted. Note that Profile creation
+ // is blocked until this initialization is complete.
+ void InitializeUserPolicy(const std::string& user_name,
+ bool wait_for_policy_fetch);
// Installs a token service for user policy.
void SetUserPolicyTokenService(TokenService* token_service);
// Registers for user policy (if not already registered), using the passed
- // OAuth V2 token for authentication.
+ // OAuth V2 token for authentication. |oauth_token| can be empty to signal
+ // that an attempt to fetch the token was made but failed, or that oauth
+ // isn't being used.
void RegisterForUserPolicy(const std::string& oauth_token);
const CloudPolicyDataStore* GetDeviceCloudPolicyDataStore() const;
@@ -112,6 +118,11 @@ class BrowserPolicyConnector : public content::NotificationObserver {
const ConfigurationPolicyHandlerList* GetHandlerList() const;
+ // Works out the user affiliation by checking the given |user_name| against
+ // the installation attributes.
+ policy::CloudPolicyDataStore::UserAffiliation GetUserAffiliation(
+ const std::string& user_name);
+
private:
friend class ::TestingBrowserProcess;
@@ -138,11 +149,6 @@ class BrowserPolicyConnector : public content::NotificationObserver {
// be running.
void InitializeDevicePolicySubsystem();
- // Works out the user affiliation by checking the given |user_name| against
- // the installation attributes.
- policy::CloudPolicyDataStore::UserAffiliation GetUserAffiliation(
- const std::string& user_name);
-
static BrowserPolicyConnector* CreateForTests();
static ConfigurationPolicyProvider* CreateManagedPlatformProvider();
static ConfigurationPolicyProvider* CreateRecommendedPlatformProvider();

Powered by Google App Engine
This is Rietveld 408576698