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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_common.h

Issue 63053003: Ask libaddressinput for address components to use in requestAutocomplete(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 1 month 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/ui/autofill/autofill_dialog_common.h
diff --git a/chrome/browser/ui/autofill/autofill_dialog_common.h b/chrome/browser/ui/autofill/autofill_dialog_common.h
index 91ce21c3ffe471c36e01f87c7a6221884ddd2281..cfb72da11246f6fcd0c08ce076ff37b4b51d68b0 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_common.h
+++ b/chrome/browser/ui/autofill/autofill_dialog_common.h
@@ -34,7 +34,11 @@ bool DetailInputMatchesField(DialogSection section,
bool IsCreditCardType(ServerFieldType type);
// Constructs |inputs| from template data for a given |dialog_section|.
-void BuildInputsForSection(DialogSection dialog_section, DetailInputs* inputs);
+// |country_region| specifies the country/region code that the inputs should be
+// built for.
+void BuildInputsForSection(DialogSection dialog_section,
+ DetailInputs* inputs,
+ const std::string& country_region);
// Returns the AutofillMetrics::DIALOG_UI_*_ITEM_ADDED metric corresponding
// to the |section|.
@@ -46,9 +50,17 @@ AutofillMetrics::DialogUiEvent DialogSectionToUiItemAddedEvent(
AutofillMetrics::DialogUiEvent DialogSectionToUiSelectionChangedEvent(
DialogSection section);
-// We hardcode some values. In particular, we don't yet allow the user to change
-// the country: http://crbug.com/247518
-string16 GetHardcodedValueForType(ServerFieldType type);
+// Returns the initial value for an input |type| in |country_code|.
+base::string16 GetInitialValueForType(ServerFieldType type,
+ const std::string& country_code);
+
+// Returns the name of the country corresponding to |country_code| translated
+// into the current UI locale (e.g. "United States").
+base::string16 GetCountryName(const std::string& country_code);
+
+// Returns the country code given a translated |country_name| (the current UI
+// locale is assumed) (e.g. "US").
+std::string GetCountryCode(const base::string16& country_name);
} // namespace common
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698