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