| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_DEVICE_POLICY_IDENTITY_STRATEGY_H_ | 5 #ifndef CHROME_BROWSER_POLICY_DEVICE_POLICY_IDENTITY_STRATEGY_H_ |
| 6 #define CHROME_BROWSER_POLICY_DEVICE_POLICY_IDENTITY_STRATEGY_H_ | 6 #define CHROME_BROWSER_POLICY_DEVICE_POLICY_IDENTITY_STRATEGY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // be used for future authentication with DMServer. | 26 // be used for future authentication with DMServer. |
| 27 void SetAuthCredentials(const std::string& username, | 27 void SetAuthCredentials(const std::string& username, |
| 28 const std::string& auth_token); | 28 const std::string& auth_token); |
| 29 | 29 |
| 30 // Sets the device's credentials when they have been read from disk after | 30 // Sets the device's credentials when they have been read from disk after |
| 31 // a reboot. | 31 // a reboot. |
| 32 void SetDeviceManagementCredentials(const std::string& owner_email, | 32 void SetDeviceManagementCredentials(const std::string& owner_email, |
| 33 const std::string& device_id, | 33 const std::string& device_id, |
| 34 const std::string& device_token); | 34 const std::string& device_token); |
| 35 | 35 |
| 36 // Initiates a policy fetch after a successful device registration. This |
| 37 // function should be called only after the device token has been fetched |
| 38 // either through the DMServer or loaded from the cache. |
| 39 void FetchPolicy(); |
| 40 |
| 36 // CloudPolicyIdentityStrategy implementation: | 41 // CloudPolicyIdentityStrategy implementation: |
| 37 virtual std::string GetDeviceToken() OVERRIDE; | 42 virtual std::string GetDeviceToken() OVERRIDE; |
| 38 virtual std::string GetDeviceID() OVERRIDE; | 43 virtual std::string GetDeviceID() OVERRIDE; |
| 39 virtual std::string GetMachineID() OVERRIDE; | 44 virtual std::string GetMachineID() OVERRIDE; |
| 40 virtual std::string GetMachineModel() OVERRIDE; | 45 virtual std::string GetMachineModel() OVERRIDE; |
| 41 virtual em::DeviceRegisterRequest_Type GetPolicyRegisterType() OVERRIDE; | 46 virtual em::DeviceRegisterRequest_Type GetPolicyRegisterType() OVERRIDE; |
| 42 virtual std::string GetPolicyType() OVERRIDE; | 47 virtual std::string GetPolicyType() OVERRIDE; |
| 43 virtual bool GetCredentials(std::string* username, | 48 virtual bool GetCredentials(std::string* username, |
| 44 std::string* auth_token) OVERRIDE; | 49 std::string* auth_token) OVERRIDE; |
| 45 virtual void OnDeviceTokenAvailable(const std::string& token) OVERRIDE; | 50 virtual void OnDeviceTokenAvailable(const std::string& token) OVERRIDE; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 60 | 65 |
| 61 // Current token. Empty if not available. | 66 // Current token. Empty if not available. |
| 62 std::string device_token_; | 67 std::string device_token_; |
| 63 | 68 |
| 64 DISALLOW_COPY_AND_ASSIGN(DevicePolicyIdentityStrategy); | 69 DISALLOW_COPY_AND_ASSIGN(DevicePolicyIdentityStrategy); |
| 65 }; | 70 }; |
| 66 | 71 |
| 67 } // namespace policy | 72 } // namespace policy |
| 68 | 73 |
| 69 #endif // CHROME_BROWSER_POLICY_DEVICE_POLICY_IDENTITY_STRATEGY_H_ | 74 #endif // CHROME_BROWSER_POLICY_DEVICE_POLICY_IDENTITY_STRATEGY_H_ |
| OLD | NEW |