| 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). Pass |true| if policy fetch was successful (either | 135 // have completed). |
| 136 // because policy was successfully fetched, or if DMServer has notified us | 136 void CancelWaitForPolicyFetch(); |
| 137 // that the user is not managed). | |
| 138 void CancelWaitForPolicyFetch(bool success); | |
| 139 | 137 |
| 140 void StartRefreshSchedulerIfReady(); | 138 void StartRefreshSchedulerIfReady(); |
| 141 | 139 |
| 142 // Owns the store, note that CloudPolicyManager just keeps a plain pointer. | 140 // Owns the store, note that CloudPolicyManager just keeps a plain pointer. |
| 143 scoped_ptr<CloudPolicyStore> store_; | 141 scoped_ptr<CloudPolicyStore> store_; |
| 144 | 142 |
| 145 // Manages external data referenced by policies. | 143 // Manages external data referenced by policies. |
| 146 scoped_ptr<CloudExternalDataManager> external_data_manager_; | 144 scoped_ptr<CloudExternalDataManager> external_data_manager_; |
| 147 | 145 |
| 148 // Username for the wildcard login check if applicable, empty otherwise. | 146 // Username for the wildcard login check if applicable, empty otherwise. |
| 149 std::string wildcard_username_; | 147 std::string wildcard_username_; |
| 150 | 148 |
| 151 // Path where policy for components will be cached. | 149 // Path where policy for components will be cached. |
| 152 base::FilePath component_policy_cache_path_; | 150 base::FilePath component_policy_cache_path_; |
| 153 | 151 |
| 154 // Whether to wait for a policy fetch to complete before reporting | 152 // Whether to wait for a policy fetch to complete before reporting |
| 155 // IsInitializationComplete(). | 153 // IsInitializationComplete(). |
| 156 bool wait_for_policy_fetch_; | 154 bool wait_for_policy_fetch_; |
| 157 | 155 |
| 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 | |
| 163 // A timer that puts a hard limit on the maximum time to wait for the initial | 156 // A timer that puts a hard limit on the maximum time to wait for the initial |
| 164 // policy fetch. | 157 // policy fetch. |
| 165 base::Timer policy_fetch_timeout_; | 158 base::Timer policy_fetch_timeout_; |
| 166 | 159 |
| 167 // The pref service to pass to the refresh scheduler on initialization. | 160 // The pref service to pass to the refresh scheduler on initialization. |
| 168 PrefService* local_state_; | 161 PrefService* local_state_; |
| 169 | 162 |
| 170 // Used to fetch the policy OAuth token, when necessary. This object holds | 163 // Used to fetch the policy OAuth token, when necessary. This object holds |
| 171 // a callback with an unretained reference to the manager, when it exists. | 164 // a callback with an unretained reference to the manager, when it exists. |
| 172 scoped_ptr<PolicyOAuth2TokenFetcher> token_fetcher_; | 165 scoped_ptr<PolicyOAuth2TokenFetcher> token_fetcher_; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 183 base::Time time_init_completed_; | 176 base::Time time_init_completed_; |
| 184 base::Time time_token_available_; | 177 base::Time time_token_available_; |
| 185 base::Time time_client_registered_; | 178 base::Time time_client_registered_; |
| 186 | 179 |
| 187 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerChromeOS); | 180 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerChromeOS); |
| 188 }; | 181 }; |
| 189 | 182 |
| 190 } // namespace policy | 183 } // namespace policy |
| 191 | 184 |
| 192 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_CHROMEOS_H_ | 185 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_CHROMEOS_H_ |
| OLD | NEW |