| 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_TOKEN_FETCHER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_DEVICE_TOKEN_FETCHER_H_ |
| 6 #define CHROME_BROWSER_POLICY_DEVICE_TOKEN_FETCHER_H_ | 6 #define CHROME_BROWSER_POLICY_DEVICE_TOKEN_FETCHER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 int64 token_fetch_error_delay_ms, | 48 int64 token_fetch_error_delay_ms, |
| 49 int64 token_fetch_error_max_delay_ms, | 49 int64 token_fetch_error_max_delay_ms, |
| 50 int64 unmanaged_device_refresh_rate_ms); | 50 int64 unmanaged_device_refresh_rate_ms); |
| 51 virtual ~DeviceTokenFetcher(); | 51 virtual ~DeviceTokenFetcher(); |
| 52 | 52 |
| 53 // Starts fetching a token. | 53 // Starts fetching a token. |
| 54 // Declared virtual so it can be overridden by mocks. | 54 // Declared virtual so it can be overridden by mocks. |
| 55 virtual void FetchToken(const std::string& auth_token, | 55 virtual void FetchToken(const std::string& auth_token, |
| 56 const std::string& device_id, | 56 const std::string& device_id, |
| 57 em::DeviceRegisterRequest_Type policy_type, | 57 em::DeviceRegisterRequest_Type policy_type, |
| 58 const std::string& machine_id); | 58 const std::string& machine_id, |
| 59 const std::string& machine_model); |
| 59 | 60 |
| 60 virtual void SetUnmanagedState(); | 61 virtual void SetUnmanagedState(); |
| 61 | 62 |
| 62 // Returns the device management token or the empty string if not available. | 63 // Returns the device management token or the empty string if not available. |
| 63 // Declared virtual so it can be overridden by mocks. | 64 // Declared virtual so it can be overridden by mocks. |
| 64 virtual const std::string& GetDeviceToken(); | 65 virtual const std::string& GetDeviceToken(); |
| 65 | 66 |
| 66 // Disables the auto-retry-on-error behavior of this token fetcher. | 67 // Disables the auto-retry-on-error behavior of this token fetcher. |
| 67 void StopAutoRetry(); | 68 void StopAutoRetry(); |
| 68 | 69 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 std::string device_token_; | 144 std::string device_token_; |
| 144 | 145 |
| 145 // Contains the AuthToken for the device management server. | 146 // Contains the AuthToken for the device management server. |
| 146 std::string auth_token_; | 147 std::string auth_token_; |
| 147 // Device identifier to send to the server. | 148 // Device identifier to send to the server. |
| 148 std::string device_id_; | 149 std::string device_id_; |
| 149 // Contains policy type to send to the server. | 150 // Contains policy type to send to the server. |
| 150 em::DeviceRegisterRequest_Type policy_type_; | 151 em::DeviceRegisterRequest_Type policy_type_; |
| 151 // Contains physical machine id to send to the server. | 152 // Contains physical machine id to send to the server. |
| 152 std::string machine_id_; | 153 std::string machine_id_; |
| 154 // Contains physical machine model to send to server. |
| 155 std::string machine_model_; |
| 153 | 156 |
| 154 // Task that has been scheduled to retry fetching a token. | 157 // Task that has been scheduled to retry fetching a token. |
| 155 CancelableTask* retry_task_; | 158 CancelableTask* retry_task_; |
| 156 | 159 |
| 157 ScopedRunnableMethodFactory<DeviceTokenFetcher> method_factory_; | 160 ScopedRunnableMethodFactory<DeviceTokenFetcher> method_factory_; |
| 158 | 161 |
| 159 ObserverList<Observer, true> observer_list_; | 162 ObserverList<Observer, true> observer_list_; |
| 160 }; | 163 }; |
| 161 | 164 |
| 162 } // namespace policy | 165 } // namespace policy |
| 163 | 166 |
| 164 #endif // CHROME_BROWSER_POLICY_DEVICE_TOKEN_FETCHER_H_ | 167 #endif // CHROME_BROWSER_POLICY_DEVICE_TOKEN_FETCHER_H_ |
| OLD | NEW |