Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Side by Side Diff: chrome/service/cloud_print/cloud_print_auth.cc

Issue 12208089: Changing CloudPrintURLFetcher instantiation to be more testable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated Gene's suggestions Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/service/cloud_print/cloud_print_connector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/service/cloud_print/cloud_print_connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698