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

Unified Diff: chrome/browser/ui/webui/options/autofill_options_handler.cc

Issue 2705773002: [Autofill] Move country combo box model from chrome to component. (Closed)
Patch Set: Rebase Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/autofill/country_combobox_model_unittest.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/autofill_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/autofill_options_handler.cc b/chrome/browser/ui/webui/options/autofill_options_handler.cc
index 8b8044ff4b917ae6a44a63f43353c679393defdf..8241b389870596fcafe9573237ec90672682a30c 100644
--- a/chrome/browser/ui/webui/options/autofill_options_handler.cc
+++ b/chrome/browser/ui/webui/options/autofill_options_handler.cc
@@ -25,13 +25,13 @@
#include "chrome/browser/autofill/personal_data_manager_factory.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/autofill/country_combobox_model.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
#include "components/autofill/core/browser/autofill_country.h"
#include "components/autofill/core/browser/autofill_data_util.h"
#include "components/autofill/core/browser/autofill_profile.h"
+#include "components/autofill/core/browser/country_combobox_model.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/payments/payments_service_url.h"
#include "components/autofill/core/browser/personal_data_manager.h"
@@ -168,9 +168,11 @@ void GetAddressComponents(const std::string& country_code,
// Sets data related to the country <select>.
void SetCountryData(const PersonalDataManager& manager,
- base::DictionaryValue* localized_strings) {
+ base::DictionaryValue* localized_strings,
+ const std::string& ui_language_code) {
autofill::CountryComboboxModel model;
- model.SetCountries(manager, base::Callback<bool(const std::string&)>());
+ model.SetCountries(manager, base::Callback<bool(const std::string&)>(),
+ ui_language_code);
const std::vector<std::unique_ptr<autofill::AutofillCountry>>& countries =
model.countries();
localized_strings->SetString("defaultCountryCode",
@@ -192,8 +194,7 @@ void SetCountryData(const PersonalDataManager& manager,
std::unique_ptr<base::ListValue> default_country_components(
new base::ListValue);
std::string default_country_language_code;
- GetAddressComponents(countries.front()->country_code(),
- g_browser_process->GetApplicationLocale(),
+ GetAddressComponents(countries.front()->country_code(), ui_language_code,
default_country_components.get(),
&default_country_language_code);
localized_strings->Set("autofillDefaultCountryComponents",
@@ -312,7 +313,8 @@ void AutofillOptionsHandler::SetAddressOverlayStrings(
l10n_util::GetStringUTF16(IDS_AUTOFILL_FIELD_LABEL_PHONE));
localized_strings->SetString("autofillEmailLabel",
l10n_util::GetStringUTF16(IDS_AUTOFILL_FIELD_LABEL_EMAIL));
- SetCountryData(*personal_data_, localized_strings);
+ SetCountryData(*personal_data_, localized_strings,
+ g_browser_process->GetApplicationLocale());
}
void AutofillOptionsHandler::SetCreditCardOverlayStrings(
« no previous file with comments | « chrome/browser/ui/autofill/country_combobox_model_unittest.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698