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 "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/policy/delayed_work_scheduler.h" | |
11 #include "chrome/browser/policy/device_management_backend.h" | 10 #include "chrome/browser/policy/device_management_backend.h" |
12 #include "chrome/browser/policy/policy_notifier.h" | |
13 #include "chrome/browser/policy/proto/device_management_backend.pb.h" | 11 #include "chrome/browser/policy/proto/device_management_backend.pb.h" |
14 | 12 |
15 namespace policy { | 13 namespace policy { |
16 | 14 |
17 class CloudPolicyCacheBase; | 15 class CloudPolicyCacheBase; |
18 class CloudPolicyDataStore; | 16 class CloudPolicyDataStore; |
| 17 class DelayedWorkScheduler; |
19 class DeviceManagementService; | 18 class DeviceManagementService; |
| 19 class PolicyNotifier; |
20 | 20 |
21 namespace em = enterprise_management; | 21 namespace em = enterprise_management; |
22 | 22 |
23 // Fetches the device token that can be used for policy requests with the device | 23 // Fetches the device token that can be used for policy requests with the device |
24 // management server, either from disk if it already has been successfully | 24 // management server, either from disk if it already has been successfully |
25 // requested, otherwise from the device management server. An instance of the | 25 // requested, otherwise from the device management server. An instance of the |
26 // fetcher is shared as a singleton by all users of the device management token | 26 // fetcher is shared as a singleton by all users of the device management token |
27 // to ensure they all get the same token. | 27 // to ensure they all get the same token. |
28 class DeviceTokenFetcher | 28 class DeviceTokenFetcher |
29 : public DeviceManagementBackend::DeviceRegisterResponseDelegate { | 29 : public DeviceManagementBackend::DeviceRegisterResponseDelegate { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 int64 token_fetch_error_max_delay_ms_; | 117 int64 token_fetch_error_max_delay_ms_; |
118 int64 effective_token_fetch_error_delay_ms_; | 118 int64 effective_token_fetch_error_delay_ms_; |
119 int64 unmanaged_device_refresh_rate_ms_; | 119 int64 unmanaged_device_refresh_rate_ms_; |
120 | 120 |
121 // State the fetcher is currently in. | 121 // State the fetcher is currently in. |
122 FetcherState state_; | 122 FetcherState state_; |
123 | 123 |
124 CloudPolicyDataStore* data_store_; | 124 CloudPolicyDataStore* data_store_; |
125 | 125 |
126 scoped_ptr<DelayedWorkScheduler> scheduler_; | 126 scoped_ptr<DelayedWorkScheduler> scheduler_; |
| 127 |
| 128 DISALLOW_COPY_AND_ASSIGN(DeviceTokenFetcher); |
127 }; | 129 }; |
128 | 130 |
129 } // namespace policy | 131 } // namespace policy |
130 | 132 |
131 #endif // CHROME_BROWSER_POLICY_DEVICE_TOKEN_FETCHER_H_ | 133 #endif // CHROME_BROWSER_POLICY_DEVICE_TOKEN_FETCHER_H_ |
OLD | NEW |