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

Side by Side Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

Issue 322453003: autocomplete: support address-line3, address-level{1,2,3} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: self review Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
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 "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" 5 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 647
648 AutofillDialogControllerImpl::~AutofillDialogControllerImpl() { 648 AutofillDialogControllerImpl::~AutofillDialogControllerImpl() {
649 if (popup_controller_) 649 if (popup_controller_)
650 popup_controller_->Hide(); 650 popup_controller_->Hide();
651 651
652 GetMetricLogger().LogDialogInitialUserState(initial_user_state_); 652 GetMetricLogger().LogDialogInitialUserState(initial_user_state_);
653 } 653 }
654 654
655 bool CountryFilter(const std::set<base::string16>& possible_values, 655 bool CountryFilter(const std::set<base::string16>& possible_values,
656 const std::string& country_code) { 656 const std::string& country_code) {
657 if (!i18ninput::CountryIsFullySupported(country_code))
658 return false;
659
660 if (!possible_values.empty() && 657 if (!possible_values.empty() &&
661 !possible_values.count(base::ASCIIToUTF16(country_code))) { 658 !possible_values.count(base::ASCIIToUTF16(country_code))) {
662 return false; 659 return false;
663 } 660 }
664 661
665 return true; 662 return true;
666 } 663 }
667 664
668 // static 665 // static
669 base::WeakPtr<AutofillDialogControllerImpl> 666 base::WeakPtr<AutofillDialogControllerImpl>
(...skipping 2355 matching lines...) Expand 10 before | Expand all | Expand 10 after
3025 !ShouldDisallowCcType(cards[i]->TypeForDisplay())); 3022 !ShouldDisallowCcType(cards[i]->TypeForDisplay()));
3026 } 3023 }
3027 3024
3028 const std::vector<AutofillProfile*>& profiles = manager->GetProfiles(); 3025 const std::vector<AutofillProfile*>& profiles = manager->GetProfiles();
3029 std::vector<base::string16> labels; 3026 std::vector<base::string16> labels;
3030 AutofillProfile::CreateDifferentiatingLabels(profiles, &labels); 3027 AutofillProfile::CreateDifferentiatingLabels(profiles, &labels);
3031 DCHECK_EQ(labels.size(), profiles.size()); 3028 DCHECK_EQ(labels.size(), profiles.size());
3032 for (size_t i = 0; i < profiles.size(); ++i) { 3029 for (size_t i = 0; i < profiles.size(); ++i) {
3033 const AutofillProfile& profile = *profiles[i]; 3030 const AutofillProfile& profile = *profiles[i];
3034 if (!i18ninput::AddressHasCompleteAndVerifiedData( 3031 if (!i18ninput::AddressHasCompleteAndVerifiedData(
3035 profile, g_browser_process->GetApplicationLocale()) || 3032 profile, g_browser_process->GetApplicationLocale())) {
3036 !i18ninput::CountryIsFullySupported(
3037 base::UTF16ToASCII(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)))) {
3038 continue; 3033 continue;
3039 } 3034 }
3040 3035
3041 // Don't add variants for addresses: name is part of credit card and 3036 // Don't add variants for addresses: name is part of credit card and
3042 // we'll just ignore email and phone number variants. 3037 // we'll just ignore email and phone number variants.
3043 suggested_shipping_.AddKeyedItem(profile.guid(), labels[i]); 3038 suggested_shipping_.AddKeyedItem(profile.guid(), labels[i]);
3044 suggested_shipping_.SetEnabled( 3039 suggested_shipping_.SetEnabled(
3045 profile.guid(), 3040 profile.guid(),
3046 CanAcceptCountry( 3041 CanAcceptCountry(
3047 SECTION_SHIPPING, 3042 SECTION_SHIPPING,
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
4096 view_->UpdateButtonStrip(); 4091 view_->UpdateButtonStrip();
4097 } 4092 }
4098 4093
4099 void AutofillDialogControllerImpl::FetchWalletCookie() { 4094 void AutofillDialogControllerImpl::FetchWalletCookie() {
4100 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); 4095 net::URLRequestContextGetter* request_context = profile_->GetRequestContext();
4101 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); 4096 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context));
4102 signin_helper_->StartWalletCookieValueFetch(); 4097 signin_helper_->StartWalletCookieValueFetch();
4103 } 4098 }
4104 4099
4105 } // namespace autofill 4100 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698