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_CLOUD_POLICY_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_POLICY_CONTROLLER_H_ |
6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_CONTROLLER_H_ | 6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_CONTROLLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 DeviceTokenFetcher* token_fetcher, | 46 DeviceTokenFetcher* token_fetcher, |
47 CloudPolicyIdentityStrategy* identity_strategy); | 47 CloudPolicyIdentityStrategy* identity_strategy); |
48 virtual ~CloudPolicyController(); | 48 virtual ~CloudPolicyController(); |
49 | 49 |
50 // Sets the refresh rate at which to re-fetch policy information. | 50 // Sets the refresh rate at which to re-fetch policy information. |
51 void SetRefreshRate(int64 refresh_rate_milliseconds); | 51 void SetRefreshRate(int64 refresh_rate_milliseconds); |
52 | 52 |
53 // DevicePolicyResponseDelegate implementation: | 53 // DevicePolicyResponseDelegate implementation: |
54 virtual void HandlePolicyResponse( | 54 virtual void HandlePolicyResponse( |
55 const em::DevicePolicyResponse& response); | 55 const em::DevicePolicyResponse& response); |
56 virtual void HandleCloudPolicyResponse( | |
57 const em::CloudPolicyResponse& response); | |
58 virtual void OnError(DeviceManagementBackend::ErrorCode code); | 56 virtual void OnError(DeviceManagementBackend::ErrorCode code); |
59 | 57 |
60 // DeviceTokenFetcher::Observer implementation: | 58 // DeviceTokenFetcher::Observer implementation: |
61 virtual void OnDeviceTokenAvailable(); | 59 virtual void OnDeviceTokenAvailable(); |
62 | 60 |
63 // CloudPolicyIdentityStrategy::Observer implementation: | 61 // CloudPolicyIdentityStrategy::Observer implementation: |
64 virtual void OnDeviceTokenChanged(); | 62 virtual void OnDeviceTokenChanged(); |
65 virtual void OnCredentialsChanged(); | 63 virtual void OnCredentialsChanged(); |
66 | 64 |
67 private: | 65 private: |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 116 |
119 // Computes the policy refresh delay to use. | 117 // Computes the policy refresh delay to use. |
120 int64 GetRefreshDelay(); | 118 int64 GetRefreshDelay(); |
121 | 119 |
122 CloudPolicyCache* cache_; | 120 CloudPolicyCache* cache_; |
123 scoped_ptr<DeviceManagementBackend> backend_; | 121 scoped_ptr<DeviceManagementBackend> backend_; |
124 CloudPolicyIdentityStrategy* identity_strategy_; | 122 CloudPolicyIdentityStrategy* identity_strategy_; |
125 DeviceTokenFetcher* token_fetcher_; | 123 DeviceTokenFetcher* token_fetcher_; |
126 ControllerState state_; | 124 ControllerState state_; |
127 bool initial_fetch_done_; | 125 bool initial_fetch_done_; |
128 bool fallback_to_old_protocol_; | |
129 | 126 |
130 int64 policy_refresh_rate_ms_; | 127 int64 policy_refresh_rate_ms_; |
131 int policy_refresh_deviation_factor_percent_; | 128 int policy_refresh_deviation_factor_percent_; |
132 int64 policy_refresh_deviation_max_ms_; | 129 int64 policy_refresh_deviation_max_ms_; |
133 int64 policy_refresh_error_delay_ms_; | 130 int64 policy_refresh_error_delay_ms_; |
134 int64 effective_policy_refresh_error_delay_ms_; | 131 int64 effective_policy_refresh_error_delay_ms_; |
135 | 132 |
136 CancelableTask* delayed_work_task_; | 133 CancelableTask* delayed_work_task_; |
137 ScopedRunnableMethodFactory<CloudPolicyController> method_factory_; | 134 ScopedRunnableMethodFactory<CloudPolicyController> method_factory_; |
138 | 135 |
139 DISALLOW_COPY_AND_ASSIGN(CloudPolicyController); | 136 DISALLOW_COPY_AND_ASSIGN(CloudPolicyController); |
140 }; | 137 }; |
141 | 138 |
142 } // namespace policy | 139 } // namespace policy |
143 | 140 |
144 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_CONTROLLER_H_ | 141 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_CONTROLLER_H_ |
OLD | NEW |