| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/autofill/content/browser/wallet/wallet_client.h" | 5 #include "components/autofill/content/browser/wallet/wallet_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 ACCEPT_LEGAL_DOCUMENTS); | 523 ACCEPT_LEGAL_DOCUMENTS); |
| 524 } | 524 } |
| 525 | 525 |
| 526 void WalletClient::MakeWalletRequest(const GURL& url, | 526 void WalletClient::MakeWalletRequest(const GURL& url, |
| 527 const std::string& post_body, | 527 const std::string& post_body, |
| 528 const std::string& mime_type, | 528 const std::string& mime_type, |
| 529 RequestType request_type) { | 529 RequestType request_type) { |
| 530 DCHECK_EQ(request_type_, NO_REQUEST); | 530 DCHECK_EQ(request_type_, NO_REQUEST); |
| 531 request_type_ = request_type; | 531 request_type_ = request_type; |
| 532 | 532 |
| 533 request_.reset(net::URLFetcher::Create( | 533 request_ = net::URLFetcher::Create(0, url, net::URLFetcher::POST, this); |
| 534 0, url, net::URLFetcher::POST, this)); | |
| 535 request_->SetRequestContext(context_getter_.get()); | 534 request_->SetRequestContext(context_getter_.get()); |
| 536 DVLOG(1) << "Making request to " << url << " with post_body=" << post_body; | 535 DVLOG(1) << "Making request to " << url << " with post_body=" << post_body; |
| 537 request_->SetUploadData(mime_type, post_body); | 536 request_->SetUploadData(mime_type, post_body); |
| 538 request_->AddExtraRequestHeader("Authorization: GoogleLogin auth=" + | 537 request_->AddExtraRequestHeader("Authorization: GoogleLogin auth=" + |
| 539 delegate_->GetWalletCookieValue()); | 538 delegate_->GetWalletCookieValue()); |
| 540 DVLOG(1) << "Setting authorization header value to " | 539 DVLOG(1) << "Setting authorization header value to " |
| 541 << delegate_->GetWalletCookieValue(); | 540 << delegate_->GetWalletCookieValue(); |
| 542 request_started_timestamp_ = base::Time::Now(); | 541 request_started_timestamp_ = base::Time::Now(); |
| 543 request_->Start(); | 542 request_->Start(); |
| 544 | 543 |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 NOTREACHED(); | 798 NOTREACHED(); |
| 800 return AutofillMetrics::UNKNOWN_API_CALL; | 799 return AutofillMetrics::UNKNOWN_API_CALL; |
| 801 } | 800 } |
| 802 | 801 |
| 803 NOTREACHED(); | 802 NOTREACHED(); |
| 804 return AutofillMetrics::UNKNOWN_API_CALL; | 803 return AutofillMetrics::UNKNOWN_API_CALL; |
| 805 } | 804 } |
| 806 | 805 |
| 807 } // namespace wallet | 806 } // namespace wallet |
| 808 } // namespace autofill | 807 } // namespace autofill |
| OLD | NEW |