| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_CHROMEOS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // case |wait_for_policy_fetch_| is true. |success| is true if the fetch was | 125 // case |wait_for_policy_fetch_| is true. |success| is true if the fetch was |
| 126 // successful. | 126 // successful. |
| 127 void OnInitialPolicyFetchComplete(bool success); | 127 void OnInitialPolicyFetchComplete(bool success); |
| 128 | 128 |
| 129 // Called when |policy_fetch_timeout_| times out, to cancel the blocking | 129 // Called when |policy_fetch_timeout_| times out, to cancel the blocking |
| 130 // wait for the initial policy fetch. | 130 // wait for the initial policy fetch. |
| 131 void OnBlockingFetchTimeout(); | 131 void OnBlockingFetchTimeout(); |
| 132 | 132 |
| 133 // Cancels waiting for the policy fetch and flags the | 133 // Cancels waiting for the policy fetch and flags the |
| 134 // ConfigurationPolicyProvider ready (assuming all other initialization tasks | 134 // ConfigurationPolicyProvider ready (assuming all other initialization tasks |
| 135 // have completed). | 135 // have completed). Pass |true| if policy fetch was successful (either |
| 136 void CancelWaitForPolicyFetch(); | 136 // because policy was successfully fetched, or if DMServer has notified us |
| 137 // that the user is not managed). |
| 138 void CancelWaitForPolicyFetch(bool success); |
| 137 | 139 |
| 138 void StartRefreshSchedulerIfReady(); | 140 void StartRefreshSchedulerIfReady(); |
| 139 | 141 |
| 140 // Owns the store, note that CloudPolicyManager just keeps a plain pointer. | 142 // Owns the store, note that CloudPolicyManager just keeps a plain pointer. |
| 141 scoped_ptr<CloudPolicyStore> store_; | 143 scoped_ptr<CloudPolicyStore> store_; |
| 142 | 144 |
| 143 // Manages external data referenced by policies. | 145 // Manages external data referenced by policies. |
| 144 scoped_ptr<CloudExternalDataManager> external_data_manager_; | 146 scoped_ptr<CloudExternalDataManager> external_data_manager_; |
| 145 | 147 |
| 146 // Username for the wildcard login check if applicable, empty otherwise. | 148 // Username for the wildcard login check if applicable, empty otherwise. |
| 147 std::string wildcard_username_; | 149 std::string wildcard_username_; |
| 148 | 150 |
| 149 // Path where policy for components will be cached. | 151 // Path where policy for components will be cached. |
| 150 base::FilePath component_policy_cache_path_; | 152 base::FilePath component_policy_cache_path_; |
| 151 | 153 |
| 152 // Whether to wait for a policy fetch to complete before reporting | 154 // Whether to wait for a policy fetch to complete before reporting |
| 153 // IsInitializationComplete(). | 155 // IsInitializationComplete(). |
| 154 bool wait_for_policy_fetch_; | 156 bool wait_for_policy_fetch_; |
| 155 | 157 |
| 158 // Whether we should allow policy fetches to fail, or wait forever until they |
| 159 // succeed (typically we won't allow them to fail until we have loaded policy |
| 160 // at least once). |
| 161 bool allow_failed_policy_fetches_; |
| 162 |
| 156 // A timer that puts a hard limit on the maximum time to wait for the initial | 163 // A timer that puts a hard limit on the maximum time to wait for the initial |
| 157 // policy fetch. | 164 // policy fetch. |
| 158 base::Timer policy_fetch_timeout_; | 165 base::Timer policy_fetch_timeout_; |
| 159 | 166 |
| 160 // The pref service to pass to the refresh scheduler on initialization. | 167 // The pref service to pass to the refresh scheduler on initialization. |
| 161 PrefService* local_state_; | 168 PrefService* local_state_; |
| 162 | 169 |
| 163 // Used to fetch the policy OAuth token, when necessary. This object holds | 170 // Used to fetch the policy OAuth token, when necessary. This object holds |
| 164 // a callback with an unretained reference to the manager, when it exists. | 171 // a callback with an unretained reference to the manager, when it exists. |
| 165 scoped_ptr<PolicyOAuth2TokenFetcher> token_fetcher_; | 172 scoped_ptr<PolicyOAuth2TokenFetcher> token_fetcher_; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 176 base::Time time_init_completed_; | 183 base::Time time_init_completed_; |
| 177 base::Time time_token_available_; | 184 base::Time time_token_available_; |
| 178 base::Time time_client_registered_; | 185 base::Time time_client_registered_; |
| 179 | 186 |
| 180 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerChromeOS); | 187 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerChromeOS); |
| 181 }; | 188 }; |
| 182 | 189 |
| 183 } // namespace policy | 190 } // namespace policy |
| 184 | 191 |
| 185 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_CHROMEOS_H_ | 192 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_CHROMEOS_H_ |
| OLD | NEW |