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

Side by Side Diff: chrome/browser/ui/webui/options/autofill_options_handler.cc

Issue 847023002: Changes to android autofill preferences for wallet integration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: its own page Created 5 years, 11 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 <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 if (!IsPersonalDataLoaded()) 690 if (!IsPersonalDataLoaded())
691 return; 691 return;
692 692
693 scoped_ptr<base::ListValue> list_value = ValidatePhoneArguments(args); 693 scoped_ptr<base::ListValue> list_value = ValidatePhoneArguments(args);
694 694
695 web_ui()->CallJavascriptFunction( 695 web_ui()->CallJavascriptFunction(
696 "AutofillEditAddressOverlay.setValidatedPhoneNumbers", *list_value); 696 "AutofillEditAddressOverlay.setValidatedPhoneNumbers", *list_value);
697 } 697 }
698 698
699 void AutofillOptionsHandler::RemaskServerCards(const base::ListValue* args) { 699 void AutofillOptionsHandler::RemaskServerCards(const base::ListValue* args) {
700 const std::vector<CreditCard*>& cards = personal_data_->GetCreditCards(); 700 personal_data_->ResetFullServerCards();
701 for (const auto card : cards) {
702 CreditCard card_copy = *card;
703 if (card_copy.record_type() == CreditCard::FULL_SERVER_CARD) {
704 card_copy.set_record_type(CreditCard::MASKED_SERVER_CARD);
705 card_copy.SetNumber(card->LastFourDigits());
706 personal_data_->UpdateServerCreditCard(card_copy);
707 }
708 }
709 } 701 }
710 702
711 bool AutofillOptionsHandler::IsPersonalDataLoaded() const { 703 bool AutofillOptionsHandler::IsPersonalDataLoaded() const {
712 return personal_data_ && personal_data_->IsDataLoaded(); 704 return personal_data_ && personal_data_->IsDataLoaded();
713 } 705 }
714 706
715 // static 707 // static
716 void AutofillOptionsHandler::AutofillProfileToDictionary( 708 void AutofillOptionsHandler::AutofillProfileToDictionary(
717 const autofill::AutofillProfile& profile, 709 const autofill::AutofillProfile& profile,
718 base::DictionaryValue* address) { 710 base::DictionaryValue* address) {
(...skipping 27 matching lines...) Expand all
746 scoped_ptr<base::ListValue> components(new base::ListValue); 738 scoped_ptr<base::ListValue> components(new base::ListValue);
747 GetAddressComponents( 739 GetAddressComponents(
748 base::UTF16ToUTF8(profile.GetRawInfo(autofill::ADDRESS_HOME_COUNTRY)), 740 base::UTF16ToUTF8(profile.GetRawInfo(autofill::ADDRESS_HOME_COUNTRY)),
749 profile.language_code(), 741 profile.language_code(),
750 components.get(), 742 components.get(),
751 NULL); 743 NULL);
752 address->Set(kComponents, components.release()); 744 address->Set(kComponents, components.release());
753 } 745 }
754 746
755 } // namespace options 747 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698