Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / autofill / data_model_wrapper.h
index 3ff868c..f755697 100644 (file)
@@ -69,6 +69,10 @@ 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.
+  virtual const std::string& GetLanguageCode() const = 0;
+
   // 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 +101,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
@@ -136,6 +141,7 @@ class AutofillCreditCardWrapper : public DataModelWrapper {
   virtual gfx::Image GetIcon() OVERRIDE;
   virtual bool GetDisplayText(base::string16* vertically_compact,
                               base::string16* horizontally_compact) OVERRIDE;
+  virtual const std::string& GetLanguageCode() const OVERRIDE;
 
  private:
   const CreditCard* card_;
@@ -154,6 +160,7 @@ class WalletAddressWrapper : public DataModelWrapper {
       OVERRIDE;
   virtual bool GetDisplayText(base::string16* vertically_compact,
                               base::string16* horizontally_compact) OVERRIDE;
+  virtual const std::string& GetLanguageCode() const OVERRIDE;
 
  private:
   const wallet::Address* address_;
@@ -174,6 +181,7 @@ class WalletInstrumentWrapper : public DataModelWrapper {
   virtual gfx::Image GetIcon() OVERRIDE;
   virtual bool GetDisplayText(base::string16* vertically_compact,
                               base::string16* horizontally_compact) OVERRIDE;
+  virtual const std::string& GetLanguageCode() const OVERRIDE;
 
  private:
   const wallet::WalletItems::MaskedInstrument* instrument_;
@@ -190,6 +198,7 @@ class FullWalletBillingWrapper : public DataModelWrapper {
   virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE;
   virtual bool GetDisplayText(base::string16* vertically_compact,
                               base::string16* horizontally_compact) OVERRIDE;
+  virtual const std::string& GetLanguageCode() const OVERRIDE;
 
  private:
   wallet::FullWallet* full_wallet_;
@@ -204,6 +213,7 @@ class FullWalletShippingWrapper : public DataModelWrapper {
   virtual ~FullWalletShippingWrapper();
 
   virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE;
+  virtual const std::string& GetLanguageCode() const OVERRIDE;
 
  private:
   wallet::FullWallet* full_wallet_;
@@ -219,6 +229,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_;