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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 148 |
149 void CloudPrintAuth::OnNetworkError(int response_code) { | 149 void CloudPrintAuth::OnNetworkError(int response_code) { |
150 // Since we specify infinite retries on network errors, this should never | 150 // Since we specify infinite retries on network errors, this should never |
151 // be called. | 151 // be called. |
152 NOTREACHED() << | 152 NOTREACHED() << |
153 "OnNetworkError invoked when not expected, response code is " << | 153 "OnNetworkError invoked when not expected, response code is " << |
154 response_code; | 154 response_code; |
155 } | 155 } |
156 | 156 |
157 CloudPrintURLFetcher::ResponseAction CloudPrintAuth::HandleJSONData( | 157 CloudPrintURLFetcher::ResponseAction CloudPrintAuth::HandleJSONData( |
158 const content::URLFetcher* source, | 158 const net::URLFetcher* source, |
159 const GURL& url, | 159 const GURL& url, |
160 base::DictionaryValue* json_data, | 160 base::DictionaryValue* json_data, |
161 bool succeeded) { | 161 bool succeeded) { |
162 if (!succeeded) { | 162 if (!succeeded) { |
163 VLOG(1) << "CP_AUTH: Creating robot account failed"; | 163 VLOG(1) << "CP_AUTH: Creating robot account failed"; |
164 client_->OnInvalidCredentials(); | 164 client_->OnInvalidCredentials(); |
165 return CloudPrintURLFetcher::STOP_PROCESSING; | 165 return CloudPrintURLFetcher::STOP_PROCESSING; |
166 } | 166 } |
167 | 167 |
168 std::string auth_code; | 168 std::string auth_code; |
(...skipping 26 matching lines...) Expand all Loading... |
195 std::string CloudPrintAuth::GetAuthHeader() { | 195 std::string CloudPrintAuth::GetAuthHeader() { |
196 DCHECK(!client_login_token_.empty()); | 196 DCHECK(!client_login_token_.empty()); |
197 std::string header; | 197 std::string header; |
198 header = "Authorization: GoogleLogin auth="; | 198 header = "Authorization: GoogleLogin auth="; |
199 header += client_login_token_; | 199 header += client_login_token_; |
200 return header; | 200 return header; |
201 } | 201 } |
202 | 202 |
203 CloudPrintAuth::~CloudPrintAuth() {} | 203 CloudPrintAuth::~CloudPrintAuth() {} |
204 | 204 |
OLD | NEW |