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

Side by Side Diff: chrome/browser/ui/webui/options/autofill_options_handler.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 (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/browser/ui/webui/options/autofill_options_handler.h" 5 #include "chrome/browser/ui/webui/options/autofill_options_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 // quickly click again on the list item before the item is removed (since 446 // quickly click again on the list item before the item is removed (since
447 // the list is not updated until the model tells the list an item has been 447 // the list is not updated until the model tells the list an item has been
448 // removed). This will activate the editor for a profile that has been 448 // removed). This will activate the editor for a profile that has been
449 // removed. Do nothing in that case. 449 // removed. Do nothing in that case.
450 return; 450 return;
451 } 451 }
452 452
453 base::DictionaryValue credit_card_data; 453 base::DictionaryValue credit_card_data;
454 credit_card_data.SetString("guid", credit_card->guid()); 454 credit_card_data.SetString("guid", credit_card->guid());
455 credit_card_data.SetString( 455 credit_card_data.SetString(
456 "nameOnCard", 456 "nameOnCard", credit_card->GetRawInfo(autofill::CREDIT_CARD_NAME_FULL));
457 credit_card->GetRawInfo(autofill::CREDIT_CARD_NAME));
458 credit_card_data.SetString( 457 credit_card_data.SetString(
459 "creditCardNumber", 458 "creditCardNumber",
460 credit_card->GetRawInfo(autofill::CREDIT_CARD_NUMBER)); 459 credit_card->GetRawInfo(autofill::CREDIT_CARD_NUMBER));
461 credit_card_data.SetString( 460 credit_card_data.SetString(
462 "expirationMonth", 461 "expirationMonth",
463 credit_card->GetRawInfo(autofill::CREDIT_CARD_EXP_MONTH)); 462 credit_card->GetRawInfo(autofill::CREDIT_CARD_EXP_MONTH));
464 credit_card_data.SetString( 463 credit_card_data.SetString(
465 "expirationYear", 464 "expirationYear",
466 credit_card->GetRawInfo(autofill::CREDIT_CARD_EXP_4_DIGIT_YEAR)); 465 credit_card->GetRawInfo(autofill::CREDIT_CARD_EXP_4_DIGIT_YEAR));
467 466
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 std::string guid; 535 std::string guid;
537 if (!args->GetString(0, &guid)) { 536 if (!args->GetString(0, &guid)) {
538 NOTREACHED(); 537 NOTREACHED();
539 return; 538 return;
540 } 539 }
541 540
542 CreditCard credit_card(guid, kSettingsOrigin); 541 CreditCard credit_card(guid, kSettingsOrigin);
543 542
544 base::string16 value; 543 base::string16 value;
545 if (args->GetString(1, &value)) 544 if (args->GetString(1, &value))
546 credit_card.SetRawInfo(autofill::CREDIT_CARD_NAME, value); 545 credit_card.SetRawInfo(autofill::CREDIT_CARD_NAME_FULL, value);
547 546
548 if (args->GetString(2, &value)) 547 if (args->GetString(2, &value))
549 credit_card.SetRawInfo(autofill::CREDIT_CARD_NUMBER, value); 548 credit_card.SetRawInfo(autofill::CREDIT_CARD_NUMBER, value);
550 549
551 if (args->GetString(3, &value)) 550 if (args->GetString(3, &value))
552 credit_card.SetRawInfo(autofill::CREDIT_CARD_EXP_MONTH, value); 551 credit_card.SetRawInfo(autofill::CREDIT_CARD_EXP_MONTH, value);
553 552
554 if (args->GetString(4, &value)) 553 if (args->GetString(4, &value))
555 credit_card.SetRawInfo(autofill::CREDIT_CARD_EXP_4_DIGIT_YEAR, value); 554 credit_card.SetRawInfo(autofill::CREDIT_CARD_EXP_4_DIGIT_YEAR, value);
556 555
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 scoped_ptr<base::ListValue> components(new base::ListValue); 609 scoped_ptr<base::ListValue> components(new base::ListValue);
611 GetAddressComponents( 610 GetAddressComponents(
612 base::UTF16ToUTF8(profile.GetRawInfo(autofill::ADDRESS_HOME_COUNTRY)), 611 base::UTF16ToUTF8(profile.GetRawInfo(autofill::ADDRESS_HOME_COUNTRY)),
613 profile.language_code(), 612 profile.language_code(),
614 components.get(), 613 components.get(),
615 NULL); 614 NULL);
616 address->Set(kComponents, components.release()); 615 address->Set(kComponents, components.release());
617 } 616 }
618 617
619 } // namespace options 618 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/data_model_wrapper.cc ('k') | chrome/test/data/autofill/autofill_creditcard_form.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698