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

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

Issue 1694443004: [Autofill] Add credit card first and last name heuristics predictions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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 <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 request_dict.SetString("encrypted_pan", "__param:s7e_1_pan"); 287 request_dict.SetString("encrypted_pan", "__param:s7e_1_pan");
288 request_dict.SetString("encrypted_cvc", "__param:s7e_13_cvc"); 288 request_dict.SetString("encrypted_cvc", "__param:s7e_13_cvc");
289 request_dict.Set("risk_data_encoded", 289 request_dict.Set("risk_data_encoded",
290 BuildRiskDictionary(request_details_.risk_data)); 290 BuildRiskDictionary(request_details_.risk_data));
291 291
292 const std::string& app_locale = request_details_.app_locale; 292 const std::string& app_locale = request_details_.app_locale;
293 scoped_ptr<base::DictionaryValue> context(new base::DictionaryValue()); 293 scoped_ptr<base::DictionaryValue> context(new base::DictionaryValue());
294 context->SetString("language_code", app_locale); 294 context->SetString("language_code", app_locale);
295 request_dict.Set("context", std::move(context)); 295 request_dict.Set("context", std::move(context));
296 296
297 request_dict.SetString("cardholder_name", 297 request_dict.SetString(
298 request_details_.card.GetInfo( 298 "cardholder_name",
299 AutofillType(CREDIT_CARD_NAME), app_locale)); 299 request_details_.card.GetInfo(AutofillType(CREDIT_CARD_NAME_FULL),
300 app_locale));
300 301
301 scoped_ptr<base::ListValue> addresses(new base::ListValue()); 302 scoped_ptr<base::ListValue> addresses(new base::ListValue());
302 for (const AutofillProfile& profile : request_details_.profiles) { 303 for (const AutofillProfile& profile : request_details_.profiles) {
303 addresses->Append(BuildAddressDictionary(profile, app_locale)); 304 addresses->Append(BuildAddressDictionary(profile, app_locale));
304 } 305 }
305 request_dict.Set("address", std::move(addresses)); 306 request_dict.Set("address", std::move(addresses));
306 307
307 request_dict.SetString("context_token", request_details_.context_token); 308 request_dict.SetString("context_token", request_details_.context_token);
308 309
309 int value = 0; 310 int value = 0;
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 537
537 void PaymentsClient::SetOAuth2TokenAndStartRequest() { 538 void PaymentsClient::SetOAuth2TokenAndStartRequest() {
538 url_fetcher_->AddExtraRequestHeader(net::HttpRequestHeaders::kAuthorization + 539 url_fetcher_->AddExtraRequestHeader(net::HttpRequestHeaders::kAuthorization +
539 std::string(": Bearer ") + access_token_); 540 std::string(": Bearer ") + access_token_);
540 541
541 url_fetcher_->Start(); 542 url_fetcher_->Start();
542 } 543 }
543 544
544 } // namespace payments 545 } // namespace payments
545 } // namespace autofill 546 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/form_structure_unittest.cc ('k') | components/autofill/core/browser/personal_data_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698