Chromium Code Reviews| 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/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | |
|
Joao da Silva
2014/01/28 14:45:46
Used?
Mattias Nissler (ping if slow)
2014/01/28 15:44:22
Done.
| |
| 15 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 16 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
| 17 #include "components/browser_context_keyed_service/browser_context_keyed_service .h" | 18 #include "components/browser_context_keyed_service/browser_context_keyed_service .h" |
| 18 #include "components/policy/core/common/cloud/cloud_policy_client.h" | 19 #include "components/policy/core/common/cloud/cloud_policy_client.h" |
| 19 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 20 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| 20 #include "components/policy/core/common/cloud/cloud_policy_manager.h" | 21 #include "components/policy/core/common/cloud/cloud_policy_manager.h" |
| 21 #include "components/policy/core/common/cloud/cloud_policy_service.h" | 22 #include "components/policy/core/common/cloud/cloud_policy_service.h" |
| 22 | 23 |
| 23 class GoogleServiceAuthError; | 24 class GoogleServiceAuthError; |
| 24 class PrefService; | 25 class PrefService; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 // the ProfileOAuth2TokenService directly to get the access token, a 3rd | 79 // the ProfileOAuth2TokenService directly to get the access token, a 3rd |
| 79 // service (UserCloudPolicyTokenForwarder) will fetch it later and pass it | 80 // service (UserCloudPolicyTokenForwarder) will fetch it later and pass it |
| 80 // to this method once available. | 81 // to this method once available. |
| 81 // The |access_token| can then be used to authenticate the registration | 82 // The |access_token| can then be used to authenticate the registration |
| 82 // request to the DMServer. | 83 // request to the DMServer. |
| 83 void OnAccessTokenAvailable(const std::string& access_token); | 84 void OnAccessTokenAvailable(const std::string& access_token); |
| 84 | 85 |
| 85 // Returns true if the underlying CloudPolicyClient is already registered. | 86 // Returns true if the underlying CloudPolicyClient is already registered. |
| 86 bool IsClientRegistered() const; | 87 bool IsClientRegistered() const; |
| 87 | 88 |
| 89 // Indicates a wildcard login check should be performed once an access token | |
| 90 // is available. | |
| 91 void EnableWildcardLoginCheck(const std::string& username); | |
| 92 | |
| 88 // ConfigurationPolicyProvider: | 93 // ConfigurationPolicyProvider: |
| 89 virtual void Shutdown() OVERRIDE; | 94 virtual void Shutdown() OVERRIDE; |
| 90 virtual bool IsInitializationComplete(PolicyDomain domain) const OVERRIDE; | 95 virtual bool IsInitializationComplete(PolicyDomain domain) const OVERRIDE; |
| 91 | 96 |
| 92 // CloudPolicyService::Observer: | 97 // CloudPolicyService::Observer: |
| 93 virtual void OnInitializationCompleted(CloudPolicyService* service) OVERRIDE; | 98 virtual void OnInitializationCompleted(CloudPolicyService* service) OVERRIDE; |
| 94 | 99 |
| 95 // CloudPolicyClient::Observer: | 100 // CloudPolicyClient::Observer: |
| 96 virtual void OnPolicyFetched(CloudPolicyClient* client) OVERRIDE; | 101 virtual void OnPolicyFetched(CloudPolicyClient* client) OVERRIDE; |
| 97 virtual void OnRegistrationStateChanged(CloudPolicyClient* client) OVERRIDE; | 102 virtual void OnRegistrationStateChanged(CloudPolicyClient* client) OVERRIDE; |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 125 void CancelWaitForPolicyFetch(); | 130 void CancelWaitForPolicyFetch(); |
| 126 | 131 |
| 127 void StartRefreshSchedulerIfReady(); | 132 void StartRefreshSchedulerIfReady(); |
| 128 | 133 |
| 129 // Owns the store, note that CloudPolicyManager just keeps a plain pointer. | 134 // Owns the store, note that CloudPolicyManager just keeps a plain pointer. |
| 130 scoped_ptr<CloudPolicyStore> store_; | 135 scoped_ptr<CloudPolicyStore> store_; |
| 131 | 136 |
| 132 // Manages external data referenced by policies. | 137 // Manages external data referenced by policies. |
| 133 scoped_ptr<CloudExternalDataManager> external_data_manager_; | 138 scoped_ptr<CloudExternalDataManager> external_data_manager_; |
| 134 | 139 |
| 140 // Username for the wildcard login check if applicable, empty otherwise. | |
| 141 std::string wildcard_username_; | |
| 142 | |
| 135 // Path where policy for components will be cached. | 143 // Path where policy for components will be cached. |
| 136 base::FilePath component_policy_cache_path_; | 144 base::FilePath component_policy_cache_path_; |
| 137 | 145 |
| 138 // Whether to wait for a policy fetch to complete before reporting | 146 // Whether to wait for a policy fetch to complete before reporting |
| 139 // IsInitializationComplete(). | 147 // IsInitializationComplete(). |
| 140 bool wait_for_policy_fetch_; | 148 bool wait_for_policy_fetch_; |
| 141 | 149 |
| 142 // A timer that puts a hard limit on the maximum time to wait for the intial | 150 // A timer that puts a hard limit on the maximum time to wait for the intial |
| 143 // policy fetch. | 151 // policy fetch. |
| 144 base::Timer policy_fetch_timeout_; | 152 base::Timer policy_fetch_timeout_; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 159 base::Time time_init_completed_; | 167 base::Time time_init_completed_; |
| 160 base::Time time_token_available_; | 168 base::Time time_token_available_; |
| 161 base::Time time_client_registered_; | 169 base::Time time_client_registered_; |
| 162 | 170 |
| 163 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerChromeOS); | 171 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerChromeOS); |
| 164 }; | 172 }; |
| 165 | 173 |
| 166 } // namespace policy | 174 } // namespace policy |
| 167 | 175 |
| 168 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_CHROMEOS_H_ | 176 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_CHROMEOS_H_ |
| OLD | NEW |