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" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 void OnClientError(CloudPolicyClient* client) override; | 102 void OnClientError(CloudPolicyClient* client) override; |
103 | 103 |
104 // ComponentCloudPolicyService::Delegate: | 104 // ComponentCloudPolicyService::Delegate: |
105 void OnComponentCloudPolicyUpdated() override; | 105 void OnComponentCloudPolicyUpdated() override; |
106 | 106 |
107 protected: | 107 protected: |
108 // CloudPolicyManager: | 108 // CloudPolicyManager: |
109 void GetChromePolicy(PolicyMap* policy_map) override; | 109 void GetChromePolicy(PolicyMap* policy_map) override; |
110 | 110 |
111 private: | 111 private: |
112 // Fetches a policy token using the authentication context of the signin | 112 // Fetches a policy token using the refresh token if available, or the |
113 // context, and calls back to OnOAuth2PolicyTokenFetched when done. | 113 // authentication context of the signin context, and calls back |
114 void FetchPolicyOAuthTokenUsingSigninContext(); | 114 // OnOAuth2PolicyTokenFetched when done. |
| 115 void FetchPolicyOAuthToken(); |
115 | 116 |
116 // Called once the policy access token is available, and starts the | 117 // Called once the policy access token is available, and starts the |
117 // registration with the policy server if the token was successfully fetched. | 118 // registration with the policy server if the token was successfully fetched. |
118 void OnOAuth2PolicyTokenFetched(const std::string& policy_token, | 119 void OnOAuth2PolicyTokenFetched(const std::string& policy_token, |
119 const GoogleServiceAuthError& error); | 120 const GoogleServiceAuthError& error); |
120 | 121 |
121 // Completion handler for the explicit policy fetch triggered on startup in | 122 // Completion handler for the explicit policy fetch triggered on startup in |
122 // case |wait_for_policy_fetch_| is true. |success| is true if the fetch was | 123 // case |wait_for_policy_fetch_| is true. |success| is true if the fetch was |
123 // successful. | 124 // successful. |
124 void OnInitialPolicyFetchComplete(bool success); | 125 void OnInitialPolicyFetchComplete(bool success); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 base::Time time_init_completed_; | 174 base::Time time_init_completed_; |
174 base::Time time_token_available_; | 175 base::Time time_token_available_; |
175 base::Time time_client_registered_; | 176 base::Time time_client_registered_; |
176 | 177 |
177 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerChromeOS); | 178 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerChromeOS); |
178 }; | 179 }; |
179 | 180 |
180 } // namespace policy | 181 } // namespace policy |
181 | 182 |
182 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_CHROMEOS_H_ | 183 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_CHROMEOS_H_ |
OLD | NEW |