| 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 <set> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 14 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" | 15 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
| 15 #include "chrome/browser/policy/chrome_browser_policy_connector.h" | 16 #include "chrome/browser/policy/chrome_browser_policy_connector.h" |
| 16 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 17 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| 17 | 18 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // connection to these dependencies to be severed earlier. | 57 // connection to these dependencies to be severed earlier. |
| 57 void PreShutdown(); | 58 void PreShutdown(); |
| 58 | 59 |
| 59 void Shutdown() override; | 60 void Shutdown() override; |
| 60 | 61 |
| 61 // Returns true if this device is managed by an enterprise (as opposed to | 62 // Returns true if this device is managed by an enterprise (as opposed to |
| 62 // a local owner). | 63 // a local owner). |
| 63 bool IsEnterpriseManaged(); | 64 bool IsEnterpriseManaged(); |
| 64 | 65 |
| 65 // Returns the enterprise domain if device is managed. | 66 // Returns the enterprise domain if device is managed. |
| 66 std::string GetEnterpriseDomain(); | 67 std::string GetEnterpriseDomain() const; |
| 67 | 68 |
| 68 // Returns the device asset ID if it is set. | 69 // Returns the device asset ID if it is set. |
| 69 std::string GetDeviceAssetID(); | 70 std::string GetDeviceAssetID(); |
| 70 | 71 |
| 71 // Returns the device mode. For ChromeOS this function will return the mode | 72 // Returns the device mode. For ChromeOS this function will return the mode |
| 72 // stored in the lockbox, or DEVICE_MODE_CONSUMER if the lockbox has been | 73 // stored in the lockbox, or DEVICE_MODE_CONSUMER if the lockbox has been |
| 73 // locked empty, or DEVICE_MODE_UNKNOWN if the device has not been owned yet. | 74 // locked empty, or DEVICE_MODE_UNKNOWN if the device has not been owned yet. |
| 74 // For other OSes the function will always return DEVICE_MODE_CONSUMER. | 75 // For other OSes the function will always return DEVICE_MODE_CONSUMER. |
| 75 DeviceMode GetDeviceMode(); | 76 DeviceMode GetDeviceMode(); |
| 76 | 77 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 EnterpriseInstallAttributes* attributes); | 138 EnterpriseInstallAttributes* attributes); |
| 138 static void RemoveInstallAttributesForTesting(); | 139 static void RemoveInstallAttributesForTesting(); |
| 139 | 140 |
| 140 // Registers device refresh rate pref. | 141 // Registers device refresh rate pref. |
| 141 static void RegisterPrefs(PrefRegistrySimple* registry); | 142 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 142 | 143 |
| 143 // DeviceCloudPolicyManagerChromeOS::Observer: | 144 // DeviceCloudPolicyManagerChromeOS::Observer: |
| 144 void OnDeviceCloudPolicyManagerConnected() override; | 145 void OnDeviceCloudPolicyManagerConnected() override; |
| 145 void OnDeviceCloudPolicyManagerDisconnected() override; | 146 void OnDeviceCloudPolicyManagerDisconnected() override; |
| 146 | 147 |
| 148 std::set<std::string> GetDeviceAffiliationIDs() const; |
| 149 |
| 147 private: | 150 private: |
| 148 // Set the timezone as soon as the policies are available. | 151 // Set the timezone as soon as the policies are available. |
| 149 void SetTimezoneIfPolicyAvailable(); | 152 void SetTimezoneIfPolicyAvailable(); |
| 150 | 153 |
| 151 // Restarts the device cloud policy initializer, because the device's | 154 // Restarts the device cloud policy initializer, because the device's |
| 152 // registration status changed from registered to unregistered. | 155 // registration status changed from registered to unregistered. |
| 153 void RestartDeviceCloudPolicyInitializer(); | 156 void RestartDeviceCloudPolicyInitializer(); |
| 154 | 157 |
| 155 // Components of the device cloud policy implementation. | 158 // Components of the device cloud policy implementation. |
| 156 scoped_ptr<ServerBackedStateKeysBroker> state_keys_broker_; | 159 scoped_ptr<ServerBackedStateKeysBroker> state_keys_broker_; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 179 scoped_ptr<NetworkConfigurationUpdater> network_configuration_updater_; | 182 scoped_ptr<NetworkConfigurationUpdater> network_configuration_updater_; |
| 180 | 183 |
| 181 base::WeakPtrFactory<BrowserPolicyConnectorChromeOS> weak_ptr_factory_; | 184 base::WeakPtrFactory<BrowserPolicyConnectorChromeOS> weak_ptr_factory_; |
| 182 | 185 |
| 183 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnectorChromeOS); | 186 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnectorChromeOS); |
| 184 }; | 187 }; |
| 185 | 188 |
| 186 } // namespace policy | 189 } // namespace policy |
| 187 | 190 |
| 188 #endif // CHROME_BROWSER_CHROMEOS_POLICY_BROWSER_POLICY_CONNECTOR_CHROMEOS_H_ | 191 #endif // CHROME_BROWSER_CHROMEOS_POLICY_BROWSER_POLICY_CONNECTOR_CHROMEOS_H_ |
| OLD | NEW |