| 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 29 matching lines...) Expand all Loading... |
| 40 DeviceTokenFetcher* token_fetcher, | 40 DeviceTokenFetcher* token_fetcher, |
| 41 CloudPolicyIdentityStrategy* identity_strategy); | 41 CloudPolicyIdentityStrategy* identity_strategy); |
| 42 virtual ~CloudPolicyController(); | 42 virtual ~CloudPolicyController(); |
| 43 | 43 |
| 44 // Sets the refresh rate at which to re-fetch policy information. | 44 // Sets the refresh rate at which to re-fetch policy information. |
| 45 void SetRefreshRate(int64 refresh_rate_milliseconds); | 45 void SetRefreshRate(int64 refresh_rate_milliseconds); |
| 46 | 46 |
| 47 // DevicePolicyResponseDelegate implementation: | 47 // DevicePolicyResponseDelegate implementation: |
| 48 virtual void HandlePolicyResponse( | 48 virtual void HandlePolicyResponse( |
| 49 const em::DevicePolicyResponse& response); | 49 const em::DevicePolicyResponse& response); |
| 50 virtual void HandleCloudPolicyResponse( | |
| 51 const em::CloudPolicyResponse& response); | |
| 52 virtual void OnError(DeviceManagementBackend::ErrorCode code); | 50 virtual void OnError(DeviceManagementBackend::ErrorCode code); |
| 53 | 51 |
| 54 // DeviceTokenFetcher::Observer implementation: | 52 // DeviceTokenFetcher::Observer implementation: |
| 55 virtual void OnDeviceTokenAvailable(); | 53 virtual void OnDeviceTokenAvailable(); |
| 56 | 54 |
| 57 // CloudPolicyIdentityStrategy::Observer implementation: | 55 // CloudPolicyIdentityStrategy::Observer implementation: |
| 58 virtual void OnDeviceTokenChanged(); | 56 virtual void OnDeviceTokenChanged(); |
| 59 virtual void OnCredentialsChanged(); | 57 virtual void OnCredentialsChanged(); |
| 60 | 58 |
| 61 private: | 59 private: |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 110 |
| 113 // Computes the policy refresh delay to use. | 111 // Computes the policy refresh delay to use. |
| 114 int64 GetRefreshDelay(); | 112 int64 GetRefreshDelay(); |
| 115 | 113 |
| 116 CloudPolicyCache* cache_; | 114 CloudPolicyCache* cache_; |
| 117 scoped_ptr<DeviceManagementBackend> backend_; | 115 scoped_ptr<DeviceManagementBackend> backend_; |
| 118 CloudPolicyIdentityStrategy* identity_strategy_; | 116 CloudPolicyIdentityStrategy* identity_strategy_; |
| 119 DeviceTokenFetcher* token_fetcher_; | 117 DeviceTokenFetcher* token_fetcher_; |
| 120 ControllerState state_; | 118 ControllerState state_; |
| 121 bool initial_fetch_done_; | 119 bool initial_fetch_done_; |
| 122 bool fallback_to_old_protocol_; | |
| 123 | 120 |
| 124 int64 policy_refresh_rate_ms_; | 121 int64 policy_refresh_rate_ms_; |
| 125 int policy_refresh_deviation_factor_percent_; | 122 int policy_refresh_deviation_factor_percent_; |
| 126 int64 policy_refresh_deviation_max_ms_; | 123 int64 policy_refresh_deviation_max_ms_; |
| 127 int64 policy_refresh_error_delay_ms_; | 124 int64 policy_refresh_error_delay_ms_; |
| 128 int64 effective_policy_refresh_error_delay_ms_; | 125 int64 effective_policy_refresh_error_delay_ms_; |
| 129 | 126 |
| 130 CancelableTask* delayed_work_task_; | 127 CancelableTask* delayed_work_task_; |
| 131 ScopedRunnableMethodFactory<CloudPolicyController> method_factory_; | 128 ScopedRunnableMethodFactory<CloudPolicyController> method_factory_; |
| 132 | 129 |
| 133 DISALLOW_COPY_AND_ASSIGN(CloudPolicyController); | 130 DISALLOW_COPY_AND_ASSIGN(CloudPolicyController); |
| 134 }; | 131 }; |
| 135 | 132 |
| 136 } // namespace policy | 133 } // namespace policy |
| 137 | 134 |
| 138 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_CONTROLLER_H_ | 135 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_CONTROLLER_H_ |
| OLD | NEW |