| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROMEOS_POLICY_BROWSER_POLICY_CONNECTOR_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_BROWSER_POLICY_CONNECTOR_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_BROWSER_POLICY_CONNECTOR_CHROMEOS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_BROWSER_POLICY_CONNECTOR_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 namespace net { | 32 namespace net { |
| 33 class URLRequestContextGetter; | 33 class URLRequestContextGetter; |
| 34 } | 34 } |
| 35 | 35 |
| 36 namespace policy { | 36 namespace policy { |
| 37 | 37 |
| 38 class AffiliatedCloudPolicyInvalidator; | 38 class AffiliatedCloudPolicyInvalidator; |
| 39 class AffiliatedInvalidationServiceProvider; | 39 class AffiliatedInvalidationServiceProvider; |
| 40 class AffiliatedRemoteCommandsInvalidator; | 40 class AffiliatedRemoteCommandsInvalidator; |
| 41 class BluetoothPolicyHandler; | 41 class BluetoothPolicyHandler; |
| 42 class DeviceActiveDirectoryPolicyManager; |
| 42 class DeviceCloudPolicyInitializer; | 43 class DeviceCloudPolicyInitializer; |
| 43 class DeviceLocalAccountPolicyService; | 44 class DeviceLocalAccountPolicyService; |
| 44 class DeviceManagementService; | 45 class DeviceManagementService; |
| 45 struct EnrollmentConfig; | 46 struct EnrollmentConfig; |
| 46 class NetworkConfigurationUpdater; | 47 class NetworkConfigurationUpdater; |
| 47 class ProxyPolicyProvider; | 48 class ProxyPolicyProvider; |
| 48 class ServerBackedStateKeysBroker; | 49 class ServerBackedStateKeysBroker; |
| 49 | 50 |
| 50 // Extends ChromeBrowserPolicyConnector with the setup specific to Chrome OS. | 51 // Extends ChromeBrowserPolicyConnector with the setup specific to Chrome OS. |
| 51 class BrowserPolicyConnectorChromeOS | 52 class BrowserPolicyConnectorChromeOS |
| (...skipping 16 matching lines...) Expand all Loading... |
| 68 | 69 |
| 69 void Shutdown() override; | 70 void Shutdown() override; |
| 70 | 71 |
| 71 // Returns true if this device is managed by an enterprise (as opposed to | 72 // Returns true if this device is managed by an enterprise (as opposed to |
| 72 // a local owner). | 73 // a local owner). |
| 73 bool IsEnterpriseManaged() const; | 74 bool IsEnterpriseManaged() const; |
| 74 | 75 |
| 75 // Returns the enterprise domain if device is managed. | 76 // Returns the enterprise domain if device is managed. |
| 76 std::string GetEnterpriseDomain() const; | 77 std::string GetEnterpriseDomain() const; |
| 77 | 78 |
| 79 // Returns the Kerberos realm (aka Windows Domain) if the device is managed by |
| 80 // Active Directory. |
| 78 std::string GetRealm() const; | 81 std::string GetRealm() const; |
| 79 | 82 |
| 80 // Returns the device asset ID if it is set. | 83 // Returns the device asset ID if it is set. |
| 81 std::string GetDeviceAssetID() const; | 84 std::string GetDeviceAssetID() const; |
| 82 | 85 |
| 83 // Returns the cloud directory API ID or an empty string if it is not set. | 86 // Returns the cloud directory API ID or an empty string if it is not set. |
| 84 std::string GetDirectoryApiID() const; | 87 std::string GetDirectoryApiID() const; |
| 85 | 88 |
| 86 // Returns the device mode. For Chrome OS this function will return the mode | 89 // Returns the device mode. For Chrome OS this function will return the mode |
| 87 // stored in the lockbox, or DEVICE_MODE_CONSUMER if the lockbox has been | 90 // stored in the lockbox, or DEVICE_MODE_CONSUMER if the lockbox has been |
| 88 // locked empty, or DEVICE_MODE_UNKNOWN if the device has not been owned yet. | 91 // locked empty, or DEVICE_MODE_UNKNOWN if the device has not been owned yet. |
| 89 // For other OSes the function will always return DEVICE_MODE_CONSUMER. | 92 // For other OSes the function will always return DEVICE_MODE_CONSUMER. |
| 90 DeviceMode GetDeviceMode() const; | 93 DeviceMode GetDeviceMode() const; |
| 91 | 94 |
| 92 // Get the enrollment configuration for the device as decided by various | 95 // Get the enrollment configuration for the device as decided by various |
| 93 // factors. See DeviceCloudPolicyInitializer::GetPrescribedEnrollmentConfig() | 96 // factors. See DeviceCloudPolicyInitializer::GetPrescribedEnrollmentConfig() |
| 94 // for details. | 97 // for details. |
| 95 EnrollmentConfig GetPrescribedEnrollmentConfig() const; | 98 EnrollmentConfig GetPrescribedEnrollmentConfig() const; |
| 96 | 99 |
| 100 // May be nullptr, e.g. for devices managed by Active Directory. |
| 97 DeviceCloudPolicyManagerChromeOS* GetDeviceCloudPolicyManager() const { | 101 DeviceCloudPolicyManagerChromeOS* GetDeviceCloudPolicyManager() const { |
| 98 return device_cloud_policy_manager_; | 102 return device_cloud_policy_manager_; |
| 99 } | 103 } |
| 100 | 104 |
| 105 // May be nullptr, e.g. for cloud-managed devices. |
| 106 DeviceActiveDirectoryPolicyManager* GetDeviceActiveDirectoryPolicyManager() |
| 107 const { |
| 108 return device_active_directory_policy_manager_; |
| 109 } |
| 110 |
| 111 // May be nullptr, e.g. for devices managed by Active Directory. |
| 101 DeviceCloudPolicyInitializer* GetDeviceCloudPolicyInitializer() const { | 112 DeviceCloudPolicyInitializer* GetDeviceCloudPolicyInitializer() const { |
| 102 return device_cloud_policy_initializer_.get(); | 113 return device_cloud_policy_initializer_.get(); |
| 103 } | 114 } |
| 104 | 115 |
| 116 // May be nullptr, e.g. for devices managed by Active Directory. |
| 105 DeviceLocalAccountPolicyService* GetDeviceLocalAccountPolicyService() const { | 117 DeviceLocalAccountPolicyService* GetDeviceLocalAccountPolicyService() const { |
| 106 return device_local_account_policy_service_.get(); | 118 return device_local_account_policy_service_.get(); |
| 107 } | 119 } |
| 108 | 120 |
| 109 chromeos::InstallAttributes* GetInstallAttributes() const { | 121 chromeos::InstallAttributes* GetInstallAttributes() const { |
| 110 return install_attributes_.get(); | 122 return install_attributes_.get(); |
| 111 } | 123 } |
| 112 | 124 |
| 125 // May be nullptr, e.g. for devices managed by Active Directory. |
| 113 ServerBackedStateKeysBroker* GetStateKeysBroker() const { | 126 ServerBackedStateKeysBroker* GetStateKeysBroker() const { |
| 114 return state_keys_broker_.get(); | 127 return state_keys_broker_.get(); |
| 115 } | 128 } |
| 116 | 129 |
| 117 // The browser-global PolicyService is created before Profiles are ready, to | 130 // The browser-global PolicyService is created before Profiles are ready, to |
| 118 // provide managed values for the local state PrefService. It includes a | 131 // provide managed values for the local state PrefService. It includes a |
| 119 // policy provider that forwards policies from a delegate policy provider. | 132 // policy provider that forwards policies from a delegate policy provider. |
| 120 // This call can be used to set the user policy provider as that delegate | 133 // This call can be used to set the user policy provider as that delegate |
| 121 // once the Profile is ready, so that user policies can also affect local | 134 // once the Profile is ready, so that user policies can also affect local |
| 122 // state preferences. | 135 // state preferences. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // Creates an attestation flow using our async method handler and | 169 // Creates an attestation flow using our async method handler and |
| 157 // cryptohome client. | 170 // cryptohome client. |
| 158 std::unique_ptr<chromeos::attestation::AttestationFlow> | 171 std::unique_ptr<chromeos::attestation::AttestationFlow> |
| 159 CreateAttestationFlow(); | 172 CreateAttestationFlow(); |
| 160 | 173 |
| 161 // Components of the device cloud policy implementation. | 174 // Components of the device cloud policy implementation. |
| 162 std::unique_ptr<ServerBackedStateKeysBroker> state_keys_broker_; | 175 std::unique_ptr<ServerBackedStateKeysBroker> state_keys_broker_; |
| 163 std::unique_ptr<chromeos::InstallAttributes> install_attributes_; | 176 std::unique_ptr<chromeos::InstallAttributes> install_attributes_; |
| 164 std::unique_ptr<AffiliatedInvalidationServiceProvider> | 177 std::unique_ptr<AffiliatedInvalidationServiceProvider> |
| 165 affiliated_invalidation_service_provider_; | 178 affiliated_invalidation_service_provider_; |
| 166 DeviceCloudPolicyManagerChromeOS* device_cloud_policy_manager_; | 179 DeviceCloudPolicyManagerChromeOS* device_cloud_policy_manager_ = nullptr; |
| 167 PrefService* local_state_; | 180 DeviceActiveDirectoryPolicyManager* device_active_directory_policy_manager_ = |
| 181 nullptr; |
| 182 PrefService* local_state_ = nullptr; |
| 168 std::unique_ptr<DeviceCloudPolicyInitializer> | 183 std::unique_ptr<DeviceCloudPolicyInitializer> |
| 169 device_cloud_policy_initializer_; | 184 device_cloud_policy_initializer_; |
| 170 std::unique_ptr<DeviceLocalAccountPolicyService> | 185 std::unique_ptr<DeviceLocalAccountPolicyService> |
| 171 device_local_account_policy_service_; | 186 device_local_account_policy_service_; |
| 172 std::unique_ptr<AffiliatedCloudPolicyInvalidator> | 187 std::unique_ptr<AffiliatedCloudPolicyInvalidator> |
| 173 device_cloud_policy_invalidator_; | 188 device_cloud_policy_invalidator_; |
| 174 std::unique_ptr<AffiliatedRemoteCommandsInvalidator> | 189 std::unique_ptr<AffiliatedRemoteCommandsInvalidator> |
| 175 device_remote_commands_invalidator_; | 190 device_remote_commands_invalidator_; |
| 176 | 191 |
| 177 std::unique_ptr<BluetoothPolicyHandler> bluetooth_policy_handler_; | 192 std::unique_ptr<BluetoothPolicyHandler> bluetooth_policy_handler_; |
| 178 | 193 |
| 179 // This policy provider is used on Chrome OS to feed user policy into the | 194 // This policy provider is used on Chrome OS to feed user policy into the |
| 180 // global PolicyService instance. This works by installing the cloud policy | 195 // global PolicyService instance. This works by installing the cloud policy |
| 181 // provider of the primary profile as the delegate of the ProxyPolicyProvider, | 196 // provider of the primary profile as the delegate of the ProxyPolicyProvider, |
| 182 // after login. | 197 // after login. |
| 183 // The provider is owned by the base class; this field is just a typed weak | 198 // The provider is owned by the base class; this field is just a typed weak |
| 184 // pointer to get to the ProxyPolicyProvider at SetUserPolicyDelegate(). | 199 // pointer to get to the ProxyPolicyProvider at SetUserPolicyDelegate(). |
| 185 ProxyPolicyProvider* global_user_cloud_policy_provider_; | 200 ProxyPolicyProvider* global_user_cloud_policy_provider_ = nullptr; |
| 186 | 201 |
| 187 std::unique_ptr<NetworkConfigurationUpdater> network_configuration_updater_; | 202 std::unique_ptr<NetworkConfigurationUpdater> network_configuration_updater_; |
| 188 | 203 |
| 189 base::WeakPtrFactory<BrowserPolicyConnectorChromeOS> weak_ptr_factory_; | 204 base::WeakPtrFactory<BrowserPolicyConnectorChromeOS> weak_ptr_factory_; |
| 190 | 205 |
| 191 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnectorChromeOS); | 206 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnectorChromeOS); |
| 192 }; | 207 }; |
| 193 | 208 |
| 194 } // namespace policy | 209 } // namespace policy |
| 195 | 210 |
| 196 #endif // CHROME_BROWSER_CHROMEOS_POLICY_BROWSER_POLICY_CONNECTOR_CHROMEOS_H_ | 211 #endif // CHROME_BROWSER_CHROMEOS_POLICY_BROWSER_POLICY_CONNECTOR_CHROMEOS_H_ |
| OLD | NEW |