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 #include "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 enrollment_step_ = STEP_ROBOT_AUTH_REFRESH; | 209 enrollment_step_ = STEP_ROBOT_AUTH_REFRESH; |
210 | 210 |
211 gaia::OAuthClientInfo client_info; | 211 gaia::OAuthClientInfo client_info; |
212 client_info.client_id = GaiaUrls::GetInstance()->oauth2_chrome_client_id(); | 212 client_info.client_id = GaiaUrls::GetInstance()->oauth2_chrome_client_id(); |
213 client_info.client_secret = | 213 client_info.client_secret = |
214 GaiaUrls::GetInstance()->oauth2_chrome_client_secret(); | 214 GaiaUrls::GetInstance()->oauth2_chrome_client_secret(); |
215 client_info.redirect_uri = "oob"; | 215 client_info.redirect_uri = "oob"; |
216 | 216 |
217 // Use the system request context to avoid sending user cookies. | 217 // Use the system request context to avoid sending user cookies. |
218 gaia_oauth_client_.reset(new gaia::GaiaOAuthClient( | 218 gaia_oauth_client_.reset(new gaia::GaiaOAuthClient( |
219 GaiaUrls::GetInstance()->oauth2_token_url(), | |
220 g_browser_process->system_request_context())); | 219 g_browser_process->system_request_context())); |
221 gaia_oauth_client_->GetTokensFromAuthCode(client_info, | 220 gaia_oauth_client_->GetTokensFromAuthCode(client_info, |
222 client->robot_api_auth_code(), | 221 client->robot_api_auth_code(), |
223 0 /* max_retries */, | 222 0 /* max_retries */, |
224 this); | 223 this); |
225 } | 224 } |
226 | 225 |
227 // GaiaOAuthClient::Delegate callback for OAuth2 refresh token fetched. | 226 // GaiaOAuthClient::Delegate callback for OAuth2 refresh token fetched. |
228 void EnrollmentHandlerChromeOS::OnGetTokensResponse( | 227 void EnrollmentHandlerChromeOS::OnGetTokensResponse( |
229 const std::string& refresh_token, | 228 const std::string& refresh_token, |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 << " " << status.client_status() | 343 << " " << status.client_status() |
345 << " " << status.validation_status() | 344 << " " << status.validation_status() |
346 << " " << status.store_status(); | 345 << " " << status.store_status(); |
347 } | 346 } |
348 | 347 |
349 if (!callback.is_null()) | 348 if (!callback.is_null()) |
350 callback.Run(status); | 349 callback.Run(status); |
351 } | 350 } |
352 | 351 |
353 } // namespace policy | 352 } // namespace policy |
OLD | NEW |