| 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/service/cloud_print/cloud_print_auth.h" | 5 #include "chrome/service/cloud_print/cloud_print_auth.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "chrome/common/cloud_print/cloud_print_constants.h" | 9 #include "chrome/common/cloud_print/cloud_print_constants.h" |
| 10 #include "chrome/common/cloud_print/cloud_print_helpers.h" | 10 #include "chrome/common/cloud_print/cloud_print_helpers.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 void CloudPrintAuth::AuthenticateWithToken( | 63 void CloudPrintAuth::AuthenticateWithToken( |
| 64 const std::string& cloud_print_token) { | 64 const std::string& cloud_print_token) { |
| 65 VLOG(1) << "CP_AUTH: Authenticating with token"; | 65 VLOG(1) << "CP_AUTH: Authenticating with token"; |
| 66 | 66 |
| 67 client_login_token_ = cloud_print_token; | 67 client_login_token_ = cloud_print_token; |
| 68 | 68 |
| 69 // We need to get the credentials of the robot here. | 69 // We need to get the credentials of the robot here. |
| 70 GURL get_authcode_url = GetUrlForGetAuthCode(cloud_print_server_url_, | 70 GURL get_authcode_url = GetUrlForGetAuthCode(cloud_print_server_url_, |
| 71 oauth_client_info_.client_id, | 71 oauth_client_info_.client_id, |
| 72 proxy_id_); | 72 proxy_id_); |
| 73 request_ = new CloudPrintURLFetcher; | 73 request_ = CloudPrintURLFetcher::Create(); |
| 74 request_->StartGetRequest(get_authcode_url, | 74 request_->StartGetRequest(get_authcode_url, |
| 75 this, | 75 this, |
| 76 kCloudPrintAuthMaxRetryCount, | 76 kCloudPrintAuthMaxRetryCount, |
| 77 std::string()); | 77 std::string()); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void CloudPrintAuth::AuthenticateWithRobotToken( | 80 void CloudPrintAuth::AuthenticateWithRobotToken( |
| 81 const std::string& robot_oauth_refresh_token, | 81 const std::string& robot_oauth_refresh_token, |
| 82 const std::string& robot_email) { | 82 const std::string& robot_email) { |
| 83 VLOG(1) << "CP_AUTH: Authenticating with robot token"; | 83 VLOG(1) << "CP_AUTH: Authenticating with robot token"; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 DCHECK(!client_login_token_.empty()); | 192 DCHECK(!client_login_token_.empty()); |
| 193 std::string header; | 193 std::string header; |
| 194 header = "Authorization: GoogleLogin auth="; | 194 header = "Authorization: GoogleLogin auth="; |
| 195 header += client_login_token_; | 195 header += client_login_token_; |
| 196 return header; | 196 return header; |
| 197 } | 197 } |
| 198 | 198 |
| 199 CloudPrintAuth::~CloudPrintAuth() {} | 199 CloudPrintAuth::~CloudPrintAuth() {} |
| 200 | 200 |
| 201 } // namespace cloud_print | 201 } // namespace cloud_print |
| OLD | NEW |