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

Unified Diff: chrome/browser/extensions/api/autofill_private/autofill_private_api.cc

Issue 2028903002: Update Autofill Private API to provide a list of available countries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: chrome/browser/extensions/api/autofill_private/autofill_private_api.cc
diff --git a/chrome/browser/extensions/api/autofill_private/autofill_private_api.cc b/chrome/browser/extensions/api/autofill_private/autofill_private_api.cc
index ce3ab6460e1c5437b1c33fd2769bf15154289f4e..c7f7da5737bea77fefef994343d44465798d2eff 100644
--- a/chrome/browser/extensions/api/autofill_private/autofill_private_api.cc
+++ b/chrome/browser/extensions/api/autofill_private/autofill_private_api.cc
@@ -279,6 +279,29 @@ ExtensionFunction::ResponseAction AutofillPrivateSaveAddressFunction::Run() {
}
////////////////////////////////////////////////////////////////////////////////
+// AutofillPrivateGetCountryListFunction
+
+AutofillPrivateGetCountryListFunction::AutofillPrivateGetCountryListFunction()
+ : chrome_details_(this) {}
+
+AutofillPrivateGetCountryListFunction::
+ ~AutofillPrivateGetCountryListFunction() {}
+
+ExtensionFunction::ResponseAction
+ AutofillPrivateGetCountryListFunction::Run() {
+ autofill::PersonalDataManager* personal_data =
+ autofill::PersonalDataManagerFactory::GetForProfile(
+ chrome_details_.GetProfile());
+ DCHECK(personal_data && personal_data->IsDataLoaded());
stevenjb 2016/06/08 03:43:23 Assuming data is loaded asynchronously, it would b
hcarmona 2016/06/08 15:05:50 Done.
+
+ autofill_util::CountryEntryList countryList =
+ extensions::autofill_util::GenerateCountryList(*personal_data);
+
+ return RespondNow(ArgumentList(
+ api::autofill_private::GetCountryList::Results::Create(countryList)));
+}
+
+////////////////////////////////////////////////////////////////////////////////
// AutofillPrivateGetAddressComponentsFunction
AutofillPrivateGetAddressComponentsFunction::

Powered by Google App Engine
This is Rietveld 408576698