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

Side by Side Diff: components/autofill/core/browser/payments/payments_client.cc

Issue 1926553002: Prompt for expiration date for local cards. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify the test cases Created 4 years, 7 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/core/browser/payments/payments_client.h" 5 #include "components/autofill/core/browser/payments/payments_client.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 SetStringIfNotEmpty(profile, PHONE_HOME_WHOLE_NUMBER, app_locale, 169 SetStringIfNotEmpty(profile, PHONE_HOME_WHOLE_NUMBER, app_locale,
170 "phone_number", address.get()); 170 "phone_number", address.get());
171 171
172 return address; 172 return address;
173 } 173 }
174 174
175 class UnmaskCardRequest : public PaymentsRequest { 175 class UnmaskCardRequest : public PaymentsRequest {
176 public: 176 public:
177 UnmaskCardRequest(const PaymentsClient::UnmaskRequestDetails& request_details) 177 UnmaskCardRequest(const PaymentsClient::UnmaskRequestDetails& request_details)
178 : request_details_(request_details) { 178 : request_details_(request_details) {
179 DCHECK_EQ(CreditCard::MASKED_SERVER_CARD, 179 DCHECK(
180 request_details.card.record_type()); 180 CreditCard::MASKED_SERVER_CARD == request_details.card.record_type() ||
181 CreditCard::FULL_SERVER_CARD == request_details.card.record_type());
181 } 182 }
182 ~UnmaskCardRequest() override {} 183 ~UnmaskCardRequest() override {}
183 184
184 std::string GetRequestUrlPath() override { return kUnmaskCardRequestPath; } 185 std::string GetRequestUrlPath() override { return kUnmaskCardRequestPath; }
185 186
186 std::string GetRequestContentType() override { 187 std::string GetRequestContentType() override {
187 return "application/x-www-form-urlencoded"; 188 return "application/x-www-form-urlencoded";
188 } 189 }
189 190
190 std::string GetRequestContent() override { 191 std::string GetRequestContent() override {
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 544
544 void PaymentsClient::SetOAuth2TokenAndStartRequest() { 545 void PaymentsClient::SetOAuth2TokenAndStartRequest() {
545 url_fetcher_->AddExtraRequestHeader(net::HttpRequestHeaders::kAuthorization + 546 url_fetcher_->AddExtraRequestHeader(net::HttpRequestHeaders::kAuthorization +
546 std::string(": Bearer ") + access_token_); 547 std::string(": Bearer ") + access_token_);
547 548
548 url_fetcher_->Start(); 549 url_fetcher_->Start();
549 } 550 }
550 551
551 } // namespace payments 552 } // namespace payments
552 } // namespace autofill 553 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698