OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ | 5 #ifndef CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ |
6 #define CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ | 6 #define CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // CloudPolicyManager and isn't being overridden by a higher-level provider. | 60 // CloudPolicyManager and isn't being overridden by a higher-level provider. |
61 bool IsPolicyFromCloudPolicy(const char* name) const; | 61 bool IsPolicyFromCloudPolicy(const char* name) const; |
62 | 62 |
63 private: | 63 private: |
64 // Find the policy provider that provides the |name| Chrome policy, if any. In | 64 // Find the policy provider that provides the |name| Chrome policy, if any. In |
65 // case of multiple providers sharing the same policy, the one with the | 65 // case of multiple providers sharing the same policy, the one with the |
66 // highest priority will be returned. | 66 // highest priority will be returned. |
67 const ConfigurationPolicyProvider* DeterminePolicyProviderForPolicy( | 67 const ConfigurationPolicyProvider* DeterminePolicyProviderForPolicy( |
68 const char* name) const; | 68 const char* name) const; |
69 | 69 |
70 #if defined(ENABLE_CONFIGURATION_POLICY) | |
71 #if defined(OS_CHROMEOS) | 70 #if defined(OS_CHROMEOS) |
72 // Some of the user policy configuration affects browser global state, and | 71 // Some of the user policy configuration affects browser global state, and |
73 // can only come from one Profile. |is_primary_user_| is true if this | 72 // can only come from one Profile. |is_primary_user_| is true if this |
74 // connector belongs to the first signed-in Profile, and in that case that | 73 // connector belongs to the first signed-in Profile, and in that case that |
75 // Profile's policy is the one that affects global policy settings in | 74 // Profile's policy is the one that affects global policy settings in |
76 // local state. | 75 // local state. |
77 bool is_primary_user_; | 76 bool is_primary_user_; |
78 | 77 |
79 scoped_ptr<ConfigurationPolicyProvider> special_user_policy_provider_; | 78 scoped_ptr<ConfigurationPolicyProvider> special_user_policy_provider_; |
80 #endif // defined(OS_CHROMEOS) | 79 #endif // defined(OS_CHROMEOS) |
81 | 80 |
82 scoped_ptr<ConfigurationPolicyProvider> wrapped_platform_policy_provider_; | 81 scoped_ptr<ConfigurationPolicyProvider> wrapped_platform_policy_provider_; |
83 CloudPolicyManager* user_cloud_policy_manager_; | 82 CloudPolicyManager* user_cloud_policy_manager_; |
84 #endif // defined(ENABLE_CONFIGURATION_POLICY) | |
85 | 83 |
86 // |policy_providers_| contains a list of the policy providers available for | 84 // |policy_providers_| contains a list of the policy providers available for |
87 // the PolicyService of this connector, in decreasing order of priority. | 85 // the PolicyService of this connector, in decreasing order of priority. |
88 // | 86 // |
89 // Note: All the providers appended to this vector must eventually become | 87 // Note: All the providers appended to this vector must eventually become |
90 // initialized for every policy domain, otherwise some subsystems will never | 88 // initialized for every policy domain, otherwise some subsystems will never |
91 // use the policies exposed by the PolicyService! | 89 // use the policies exposed by the PolicyService! |
92 // The default ConfigurationPolicyProvider::IsInitializationComplete() | 90 // The default ConfigurationPolicyProvider::IsInitializationComplete() |
93 // result is true, so take care if a provider overrides that. | 91 // result is true, so take care if a provider overrides that. |
94 std::vector<ConfigurationPolicyProvider*> policy_providers_; | 92 std::vector<ConfigurationPolicyProvider*> policy_providers_; |
95 | 93 |
96 scoped_ptr<PolicyService> policy_service_; | 94 scoped_ptr<PolicyService> policy_service_; |
97 scoped_ptr<bool> is_managed_override_; | 95 scoped_ptr<bool> is_managed_override_; |
98 | 96 |
99 DISALLOW_COPY_AND_ASSIGN(ProfilePolicyConnector); | 97 DISALLOW_COPY_AND_ASSIGN(ProfilePolicyConnector); |
100 }; | 98 }; |
101 | 99 |
102 } // namespace policy | 100 } // namespace policy |
103 | 101 |
104 #endif // CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ | 102 #endif // CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ |
OLD | NEW |