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