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

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

Issue 172783003: rAc: don't show countries with partially supported address fields for now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile Created 6 years, 10 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
« no previous file with comments | « chrome/browser/ui/autofill/country_combobox_model_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 26 matching lines...) Expand all
37 using autofill::CreditCard; 37 using autofill::CreditCard;
38 using autofill::PersonalDataManager; 38 using autofill::PersonalDataManager;
39 39
40 namespace { 40 namespace {
41 41
42 const char kSettingsOrigin[] = "Chrome settings"; 42 const char kSettingsOrigin[] = "Chrome settings";
43 43
44 // Sets data related to the country <select>. 44 // Sets data related to the country <select>.
45 void SetCountryData(const PersonalDataManager& manager, 45 void SetCountryData(const PersonalDataManager& manager,
46 base::DictionaryValue* localized_strings) { 46 base::DictionaryValue* localized_strings) {
47 autofill::CountryComboboxModel model(manager); 47 autofill::CountryComboboxModel model(manager, true);
48 const std::vector<AutofillCountry*>& countries = model.countries(); 48 const std::vector<AutofillCountry*>& countries = model.countries();
49 localized_strings->SetString("defaultCountryCode", 49 localized_strings->SetString("defaultCountryCode",
50 countries.front()->country_code()); 50 countries.front()->country_code());
51 51
52 // An ordered list of options to show in the <select>. 52 // An ordered list of options to show in the <select>.
53 scoped_ptr<base::ListValue> country_list(new base::ListValue()); 53 scoped_ptr<base::ListValue> country_list(new base::ListValue());
54 // A dictionary of postal code and state info, keyed on country code. 54 // A dictionary of postal code and state info, keyed on country code.
55 scoped_ptr<base::DictionaryValue> country_data(new base::DictionaryValue()); 55 scoped_ptr<base::DictionaryValue> country_data(new base::DictionaryValue());
56 for (size_t i = 0; i < countries.size(); ++i) { 56 for (size_t i = 0; i < countries.size(); ++i) {
57 scoped_ptr<base::DictionaryValue> option_details( 57 scoped_ptr<base::DictionaryValue> option_details(
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 604
605 web_ui()->CallJavascriptFunction( 605 web_ui()->CallJavascriptFunction(
606 "AutofillEditAddressOverlay.setValidatedPhoneNumbers", *list_value); 606 "AutofillEditAddressOverlay.setValidatedPhoneNumbers", *list_value);
607 } 607 }
608 608
609 bool AutofillOptionsHandler::IsPersonalDataLoaded() const { 609 bool AutofillOptionsHandler::IsPersonalDataLoaded() const {
610 return personal_data_ && personal_data_->IsDataLoaded(); 610 return personal_data_ && personal_data_->IsDataLoaded();
611 } 611 }
612 612
613 } // namespace options 613 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/country_combobox_model_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698