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

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

Issue 212873003: Store the language code for the address in autofill profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 6 years, 9 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/ui/autofill/data_model_wrapper.h
diff --git a/chrome/browser/ui/autofill/data_model_wrapper.h b/chrome/browser/ui/autofill/data_model_wrapper.h
index 3ff868c75d4e8809ec0848fc718310b4c487be8f..48f0792c63f22fffe8d53006e1bfdac25112213f 100644
--- a/chrome/browser/ui/autofill/data_model_wrapper.h
+++ b/chrome/browser/ui/autofill/data_model_wrapper.h
@@ -69,6 +69,11 @@ class DataModelWrapper {
virtual bool GetDisplayText(base::string16* vertically_compact,
base::string16* horizontally_compact);
+ // Returns the BCP 47 language code that should be used for formatting the
+ // data for display. The default implementation returns the current browser
+ // locale.
+ virtual const std::string& GetLanguageCode() const;
+
// Fills in |form_structure| with the data that this model contains. |inputs|
// and |comparator| are used to determine whether each field in the
// FormStructure should be filled in or left alone. Returns whether any fields
@@ -97,6 +102,7 @@ class AutofillProfileWrapper : public DataModelWrapper {
virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE;
virtual base::string16 GetInfoForDisplay(const AutofillType& type) const
OVERRIDE;
+ virtual const std::string& GetLanguageCode() const OVERRIDE;
protected:
// Returns the variant that should be used when dealing with an element that
@@ -219,6 +225,7 @@ class I18nAddressDataWrapper : public DataModelWrapper {
virtual ~I18nAddressDataWrapper();
virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE;
+ virtual const std::string& GetLanguageCode() const OVERRIDE;
private:
const ::i18n::addressinput::AddressData* address_;

Powered by Google App Engine
This is Rietveld 408576698