| 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 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // This is never NULL. | 45 // This is never NULL. |
| 46 PolicyService* policy_service() const { return policy_service_.get(); } | 46 PolicyService* policy_service() const { return policy_service_.get(); } |
| 47 | 47 |
| 48 // Returns true if this Profile is under cloud policy management. | 48 // Returns true if this Profile is under cloud policy management. |
| 49 bool IsManaged() const; | 49 bool IsManaged() const; |
| 50 | 50 |
| 51 // Returns the cloud policy management domain, if this Profile is under | 51 // Returns the cloud policy management domain, if this Profile is under |
| 52 // cloud policy management. Otherwise returns an empty string. | 52 // cloud policy management. Otherwise returns an empty string. |
| 53 std::string GetManagementDomain() const; | 53 std::string GetManagementDomain() const; |
| 54 | 54 |
| 55 // Returns true if the |name| Chrome policy is currently set via the |
| 56 // CloudPolicyManager and isn't being overridden by a higher-level provider. |
| 57 bool IsPolicyFromCloudPolicy(const char* name) const; |
| 58 |
| 55 private: | 59 private: |
| 56 #if defined(ENABLE_CONFIGURATION_POLICY) | 60 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 57 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
| 58 // Some of the user policy configuration affects browser global state, and | 62 // Some of the user policy configuration affects browser global state, and |
| 59 // can only come from one Profile. |is_primary_user_| is true if this | 63 // can only come from one Profile. |is_primary_user_| is true if this |
| 60 // connector belongs to the first signed-in Profile, and in that case that | 64 // connector belongs to the first signed-in Profile, and in that case that |
| 61 // Profile's policy is the one that affects global policy settings in | 65 // Profile's policy is the one that affects global policy settings in |
| 62 // local state. | 66 // local state. |
| 63 bool is_primary_user_; | 67 bool is_primary_user_; |
| 64 | 68 |
| 65 scoped_ptr<ConfigurationPolicyProvider> special_user_policy_provider_; | 69 scoped_ptr<ConfigurationPolicyProvider> special_user_policy_provider_; |
| 66 #endif // defined(OS_CHROMEOS) | 70 #endif // defined(OS_CHROMEOS) |
| 67 | 71 |
| 68 scoped_ptr<ConfigurationPolicyProvider> forwarding_policy_provider_; | 72 scoped_ptr<ConfigurationPolicyProvider> forwarding_policy_provider_; |
| 69 CloudPolicyManager* user_cloud_policy_manager_; | 73 CloudPolicyManager* user_cloud_policy_manager_; |
| 70 #endif // defined(ENABLE_CONFIGURATION_POLICY) | 74 #endif // defined(ENABLE_CONFIGURATION_POLICY) |
| 71 | 75 |
| 72 scoped_ptr<PolicyService> policy_service_; | 76 scoped_ptr<PolicyService> policy_service_; |
| 73 | 77 |
| 74 DISALLOW_COPY_AND_ASSIGN(ProfilePolicyConnector); | 78 DISALLOW_COPY_AND_ASSIGN(ProfilePolicyConnector); |
| 75 }; | 79 }; |
| 76 | 80 |
| 77 } // namespace policy | 81 } // namespace policy |
| 78 | 82 |
| 79 #endif // CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ | 83 #endif // CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ |
| OLD | NEW |