| 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/net/gaia/gaia_urls.h" | 9 #include "chrome/common/net/gaia/gaia_urls.h" |
| 10 #include "chrome/service/cloud_print/cloud_print_consts.h" | 10 #include "chrome/service/cloud_print/cloud_print_consts.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 oauth_client_info_(oauth_client_info), | 24 oauth_client_info_(oauth_client_info), |
| 25 cloud_print_server_url_(cloud_print_server_url), | 25 cloud_print_server_url_(cloud_print_server_url), |
| 26 proxy_id_(proxy_id) { | 26 proxy_id_(proxy_id) { |
| 27 DCHECK(client); | 27 DCHECK(client); |
| 28 if (print_sys_settings) { | 28 if (print_sys_settings) { |
| 29 // It is possible to have no print settings specified. | 29 // It is possible to have no print settings specified. |
| 30 print_system_settings_.reset(print_sys_settings->DeepCopy()); | 30 print_system_settings_.reset(print_sys_settings->DeepCopy()); |
| 31 } | 31 } |
| 32 } | 32 } |
| 33 | 33 |
| 34 CloudPrintAuth::~CloudPrintAuth() { | |
| 35 } | |
| 36 | |
| 37 void CloudPrintAuth::AuthenticateWithLsid( | 34 void CloudPrintAuth::AuthenticateWithLsid( |
| 38 const std::string& lsid, | 35 const std::string& lsid, |
| 39 const std::string& last_robot_refresh_token, | 36 const std::string& last_robot_refresh_token, |
| 40 const std::string& last_robot_email, | 37 const std::string& last_robot_email, |
| 41 const std::string& last_user_email) { | 38 const std::string& last_user_email) { |
| 42 // Keeping VLOGs for Cloud Print proxy logging. It is convinient for finding | 39 // Keeping VLOGs for Cloud Print proxy logging. It is convinient for finding |
| 43 // issues with GCP in the field, where only release version is avaialble. | 40 // issues with GCP in the field, where only release version is avaialble. |
| 44 VLOG(1) << "CP_AUTH: Authenticating with LSID"; | 41 VLOG(1) << "CP_AUTH: Authenticating with LSID"; |
| 45 scoped_refptr<ServiceGaiaAuthenticator> gaia_auth_for_print( | 42 scoped_refptr<ServiceGaiaAuthenticator> gaia_auth_for_print( |
| 46 new ServiceGaiaAuthenticator( | 43 new ServiceGaiaAuthenticator( |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 193 } |
| 197 | 194 |
| 198 std::string CloudPrintAuth::GetAuthHeader() { | 195 std::string CloudPrintAuth::GetAuthHeader() { |
| 199 DCHECK(!client_login_token_.empty()); | 196 DCHECK(!client_login_token_.empty()); |
| 200 std::string header; | 197 std::string header; |
| 201 header = "Authorization: GoogleLogin auth="; | 198 header = "Authorization: GoogleLogin auth="; |
| 202 header += client_login_token_; | 199 header += client_login_token_; |
| 203 return header; | 200 return header; |
| 204 } | 201 } |
| 205 | 202 |
| 203 CloudPrintAuth::~CloudPrintAuth() {} |
| 204 |
| OLD | NEW |