| 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/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "base/timer/timer.h" | 16 #include "base/timer/timer.h" |
| 17 #include "components/keyed_service/core/keyed_service.h" | 17 #include "components/keyed_service/core/keyed_service.h" |
| 18 #include "components/policy/core/common/cloud/cloud_policy_client.h" | 18 #include "components/policy/core/common/cloud/cloud_policy_client.h" |
| 19 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 19 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| 20 #include "components/policy/core/common/cloud/cloud_policy_manager.h" | 20 #include "components/policy/core/common/cloud/cloud_policy_manager.h" |
| 21 #include "components/policy/core/common/cloud/cloud_policy_service.h" | 21 #include "components/policy/core/common/cloud/cloud_policy_service.h" |
| 22 #include "components/user_manager/user_id.h" |
| 22 | 23 |
| 23 class GoogleServiceAuthError; | 24 class GoogleServiceAuthError; |
| 24 class PrefService; | 25 class PrefService; |
| 25 | 26 |
| 26 namespace base { | 27 namespace base { |
| 27 class SequencedTaskRunner; | 28 class SequencedTaskRunner; |
| 28 } | 29 } |
| 29 | 30 |
| 30 namespace net { | 31 namespace net { |
| 31 class URLRequestContextGetter; | 32 class URLRequestContextGetter; |
| 32 } | 33 } |
| 33 | 34 |
| 35 namespace user_manager { |
| 36 class UserID; |
| 37 } |
| 38 |
| 34 namespace policy { | 39 namespace policy { |
| 35 | 40 |
| 36 class CloudExternalDataManager; | 41 class CloudExternalDataManager; |
| 37 class DeviceManagementService; | 42 class DeviceManagementService; |
| 38 class PolicyOAuth2TokenFetcher; | 43 class PolicyOAuth2TokenFetcher; |
| 39 class WildcardLoginChecker; | 44 class WildcardLoginChecker; |
| 40 | 45 |
| 41 // UserCloudPolicyManagerChromeOS implements logic for initializing user policy | 46 // UserCloudPolicyManagerChromeOS implements logic for initializing user policy |
| 42 // on Chrome OS. | 47 // on Chrome OS. |
| 43 class UserCloudPolicyManagerChromeOS : public CloudPolicyManager, | 48 class UserCloudPolicyManagerChromeOS : public CloudPolicyManager, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // to this method once available. | 85 // to this method once available. |
| 81 // The |access_token| can then be used to authenticate the registration | 86 // The |access_token| can then be used to authenticate the registration |
| 82 // request to the DMServer. | 87 // request to the DMServer. |
| 83 void OnAccessTokenAvailable(const std::string& access_token); | 88 void OnAccessTokenAvailable(const std::string& access_token); |
| 84 | 89 |
| 85 // Returns true if the underlying CloudPolicyClient is already registered. | 90 // Returns true if the underlying CloudPolicyClient is already registered. |
| 86 bool IsClientRegistered() const; | 91 bool IsClientRegistered() const; |
| 87 | 92 |
| 88 // Indicates a wildcard login check should be performed once an access token | 93 // Indicates a wildcard login check should be performed once an access token |
| 89 // is available. | 94 // is available. |
| 90 void EnableWildcardLoginCheck(const std::string& username); | 95 void EnableWildcardLoginCheck(const user_manager::UserID& user_id); |
| 91 | 96 |
| 92 // ConfigurationPolicyProvider: | 97 // ConfigurationPolicyProvider: |
| 93 void Shutdown() override; | 98 void Shutdown() override; |
| 94 bool IsInitializationComplete(PolicyDomain domain) const override; | 99 bool IsInitializationComplete(PolicyDomain domain) const override; |
| 95 | 100 |
| 96 // CloudPolicyService::Observer: | 101 // CloudPolicyService::Observer: |
| 97 void OnInitializationCompleted(CloudPolicyService* service) override; | 102 void OnInitializationCompleted(CloudPolicyService* service) override; |
| 98 | 103 |
| 99 // CloudPolicyClient::Observer: | 104 // CloudPolicyClient::Observer: |
| 100 void OnPolicyFetched(CloudPolicyClient* client) override; | 105 void OnPolicyFetched(CloudPolicyClient* client) override; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 140 |
| 136 void StartRefreshSchedulerIfReady(); | 141 void StartRefreshSchedulerIfReady(); |
| 137 | 142 |
| 138 // Owns the store, note that CloudPolicyManager just keeps a plain pointer. | 143 // Owns the store, note that CloudPolicyManager just keeps a plain pointer. |
| 139 scoped_ptr<CloudPolicyStore> store_; | 144 scoped_ptr<CloudPolicyStore> store_; |
| 140 | 145 |
| 141 // Manages external data referenced by policies. | 146 // Manages external data referenced by policies. |
| 142 scoped_ptr<CloudExternalDataManager> external_data_manager_; | 147 scoped_ptr<CloudExternalDataManager> external_data_manager_; |
| 143 | 148 |
| 144 // Username for the wildcard login check if applicable, empty otherwise. | 149 // Username for the wildcard login check if applicable, empty otherwise. |
| 145 std::string wildcard_username_; | 150 user_manager::UserID wildcard_user_id_; |
| 146 | 151 |
| 147 // Path where policy for components will be cached. | 152 // Path where policy for components will be cached. |
| 148 base::FilePath component_policy_cache_path_; | 153 base::FilePath component_policy_cache_path_; |
| 149 | 154 |
| 150 // Whether to wait for a policy fetch to complete before reporting | 155 // Whether to wait for a policy fetch to complete before reporting |
| 151 // IsInitializationComplete(). | 156 // IsInitializationComplete(). |
| 152 bool wait_for_policy_fetch_; | 157 bool wait_for_policy_fetch_; |
| 153 | 158 |
| 154 // A timer that puts a hard limit on the maximum time to wait for the initial | 159 // A timer that puts a hard limit on the maximum time to wait for the initial |
| 155 // policy fetch. | 160 // policy fetch. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 174 base::Time time_init_completed_; | 179 base::Time time_init_completed_; |
| 175 base::Time time_token_available_; | 180 base::Time time_token_available_; |
| 176 base::Time time_client_registered_; | 181 base::Time time_client_registered_; |
| 177 | 182 |
| 178 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerChromeOS); | 183 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerChromeOS); |
| 179 }; | 184 }; |
| 180 | 185 |
| 181 } // namespace policy | 186 } // namespace policy |
| 182 | 187 |
| 183 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_CHROMEOS_H_ | 188 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_CHROMEOS_H_ |
| OLD | NEW |