| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BROWSER_POLICY_CONNECTOR_H_ | 5 #ifndef CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ |
| 6 #define CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ | 6 #define CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 // Locks the device to an enterprise domain. | 87 // Locks the device to an enterprise domain. |
| 88 EnterpriseInstallAttributes::LockResult LockDevice(const std::string& user); | 88 EnterpriseInstallAttributes::LockResult LockDevice(const std::string& user); |
| 89 | 89 |
| 90 // Returns the device serial number, or an empty string if not available. | 90 // Returns the device serial number, or an empty string if not available. |
| 91 static std::string GetSerialNumber(); | 91 static std::string GetSerialNumber(); |
| 92 | 92 |
| 93 // Returns the enterprise domain if device is managed. | 93 // Returns the enterprise domain if device is managed. |
| 94 std::string GetEnterpriseDomain(); | 94 std::string GetEnterpriseDomain(); |
| 95 | 95 |
| 96 // Returns the device mode. For ChromeOS this function will return the mode |
| 97 // stored in the lockbox, or DEVICE_MODE_CONSUMER if the lockbox has been |
| 98 // locked empty, or DEVICE_MODE_UNKNOWN if the device has not been owned yet. |
| 99 // For other OSes the function will always return DEVICE_MODE_CONSUMER. |
| 100 DeviceMode GetDeviceMode(); |
| 101 |
| 96 // Reset the device policy machinery. This stops any automatic retry behavior | 102 // Reset the device policy machinery. This stops any automatic retry behavior |
| 97 // and clears the error flags, so potential retries have a chance to succeed. | 103 // and clears the error flags, so potential retries have a chance to succeed. |
| 98 void ResetDevicePolicy(); | 104 void ResetDevicePolicy(); |
| 99 | 105 |
| 100 // Initiates device and user policy fetches, if possible. Pending fetches | 106 // Initiates device and user policy fetches, if possible. Pending fetches |
| 101 // will be cancelled. | 107 // will be cancelled. |
| 102 void FetchCloudPolicy(); | 108 void FetchCloudPolicy(); |
| 103 | 109 |
| 104 // Refreshes policies on each existing provider. | 110 // Refreshes policies on each existing provider. |
| 105 void RefreshPolicies(); | 111 void RefreshPolicies(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 117 | 123 |
| 118 // Installs a token service for user policy. | 124 // Installs a token service for user policy. |
| 119 void SetUserPolicyTokenService(TokenService* token_service); | 125 void SetUserPolicyTokenService(TokenService* token_service); |
| 120 | 126 |
| 121 // Registers for user policy (if not already registered), using the passed | 127 // Registers for user policy (if not already registered), using the passed |
| 122 // OAuth V2 token for authentication. |oauth_token| can be empty to signal | 128 // OAuth V2 token for authentication. |oauth_token| can be empty to signal |
| 123 // that an attempt to fetch the token was made but failed, or that oauth | 129 // that an attempt to fetch the token was made but failed, or that oauth |
| 124 // isn't being used. | 130 // isn't being used. |
| 125 void RegisterForUserPolicy(const std::string& oauth_token); | 131 void RegisterForUserPolicy(const std::string& oauth_token); |
| 126 | 132 |
| 127 const CloudPolicyDataStore* GetDeviceCloudPolicyDataStore() const; | 133 // The data stores should be considered read-only for everyone except for |
| 128 const CloudPolicyDataStore* GetUserCloudPolicyDataStore() const; | 134 // tests. |
| 135 CloudPolicyDataStore* GetDeviceCloudPolicyDataStore(); |
| 136 CloudPolicyDataStore* GetUserCloudPolicyDataStore(); |
| 129 | 137 |
| 130 const ConfigurationPolicyHandlerList* GetHandlerList() const; | 138 const ConfigurationPolicyHandlerList* GetHandlerList() const; |
| 131 | 139 |
| 132 // Works out the user affiliation by checking the given |user_name| against | 140 // Works out the user affiliation by checking the given |user_name| against |
| 133 // the installation attributes. | 141 // the installation attributes. |
| 134 UserAffiliation GetUserAffiliation(const std::string& user_name); | 142 UserAffiliation GetUserAffiliation(const std::string& user_name); |
| 135 | 143 |
| 136 private: | 144 private: |
| 137 // content::NotificationObserver method overrides: | 145 // content::NotificationObserver method overrides: |
| 138 virtual void Observe(int type, | 146 virtual void Observe(int type, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 190 |
| 183 // Used to convert policies to preferences. | 191 // Used to convert policies to preferences. |
| 184 ConfigurationPolicyHandlerList handler_list_; | 192 ConfigurationPolicyHandlerList handler_list_; |
| 185 | 193 |
| 186 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector); | 194 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector); |
| 187 }; | 195 }; |
| 188 | 196 |
| 189 } // namespace policy | 197 } // namespace policy |
| 190 | 198 |
| 191 #endif // CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ | 199 #endif // CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ |
| OLD | NEW |