Index: chrome/browser/policy/profile_policy_connector.h |
diff --git a/chrome/browser/policy/profile_policy_connector.h b/chrome/browser/policy/profile_policy_connector.h |
index 8ef8f22cd343a4dadfa5e98c7447467a5635f6d4..c2d2fc5ed989d4738cbc0f9d49775c2b408b0659 100644 |
--- a/chrome/browser/policy/profile_policy_connector.h |
+++ b/chrome/browser/policy/profile_policy_connector.h |
@@ -19,24 +19,24 @@ class User; |
namespace policy { |
-class CloudPolicyManager; |
+class CloudPolicyStore; |
class ConfigurationPolicyProvider; |
class PolicyService; |
class SchemaRegistry; |
-// A KeyedService that creates and manages the per-Profile policy |
-// components. |
+// A KeyedService that creates and manages the per-Profile policy components. |
class ProfilePolicyConnector : public KeyedService { |
public: |
ProfilePolicyConnector(); |
~ProfilePolicyConnector() override; |
- void Init( |
-#if defined(OS_CHROMEOS) |
- const user_manager::User* user, |
-#endif |
- SchemaRegistry* schema_registry, |
- CloudPolicyManager* user_cloud_policy_manager); |
+ // |user| is only used in Chrome OS builds and should be set to nullptr |
+ // otherwise. |configuration_policy_provider| and |policy_store| are nullptr |
+ // for non-regular users. |
+ void Init(const user_manager::User* user, |
+ SchemaRegistry* schema_registry, |
+ ConfigurationPolicyProvider* configuration_policy_provider, |
+ const CloudPolicyStore* policy_store); |
void InitForTesting(std::unique_ptr<PolicyService> service); |
void OverrideIsManagedForTesting(bool is_managed); |
@@ -47,25 +47,26 @@ class ProfilePolicyConnector : public KeyedService { |
// This is never NULL. |
PolicyService* policy_service() const { return policy_service_.get(); } |
- // Returns true if this Profile is under cloud policy management. You must |
- // call this method only when the policies system is fully initialized. |
+ // Returns true if this Profile is under any kind of policy management. You |
+ // must call this method only when the policies system is fully initialized. |
bool IsManaged() const; |
- // Returns the cloud policy management domain, if this Profile is under |
- // cloud policy management. Otherwise returns an empty string. You must call |
- // this method only when the policies system is fully initialized. |
+ // Returns the cloud policy management domain or the Active Directory realm |
+ // for managed Profiles or an empty string for unmanaged Profiles. You must |
+ // call this method only when the policies system is fully initialized. |
std::string GetManagementDomain() const; |
- // Returns true if the |name| Chrome user policy is currently set via the |
- // CloudPolicyManager and isn't being overridden by a higher-level provider. |
- bool IsPolicyFromCloudPolicy(const char* name) const; |
+ // Returns true if the |policy_key| user policy is currently set via the |
+ // |configuration_policy_provider_| and isn't being overridden by a |
+ // higher-level provider. |
+ bool IsProfilePolicy(const char* policy_key) const; |
private: |
- // Find the policy provider that provides the |name| Chrome policy, if any. In |
+ // Find the policy provider that provides the |policy_key| policy, if any. In |
// case of multiple providers sharing the same policy, the one with the |
// highest priority will be returned. |
const ConfigurationPolicyProvider* DeterminePolicyProviderForPolicy( |
- const char* name) const; |
+ const char* policy_key) const; |
#if defined(OS_CHROMEOS) |
// Some of the user policy configuration affects browser global state, and |
@@ -73,14 +74,15 @@ class ProfilePolicyConnector : public KeyedService { |
// connector belongs to the first signed-in Profile, and in that case that |
// Profile's policy is the one that affects global policy settings in |
// local state. |
- bool is_primary_user_; |
+ bool is_primary_user_ = false; |
std::unique_ptr<ConfigurationPolicyProvider> special_user_policy_provider_; |
#endif // defined(OS_CHROMEOS) |
std::unique_ptr<ConfigurationPolicyProvider> |
wrapped_platform_policy_provider_; |
- CloudPolicyManager* user_cloud_policy_manager_; |
+ const ConfigurationPolicyProvider* configuration_policy_provider_ = nullptr; |
+ const CloudPolicyStore* policy_store_ = nullptr; |
// |policy_providers_| contains a list of the policy providers available for |
// the PolicyService of this connector, in decreasing order of priority. |