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 4d1c9a4da533de11004a24b0de393058052063dd..3f08ed33e6b1e3ac85bb2f17c3e6f52bc2307f7b 100644 |
--- a/chrome/browser/ui/autofill/data_model_wrapper.h |
+++ b/chrome/browser/ui/autofill/data_model_wrapper.h |
@@ -35,7 +35,7 @@ class DataModelWrapper { |
virtual ~DataModelWrapper(); |
// Returns the data for a specific autocomplete type. |
- virtual string16 GetInfo(const AutofillType& type) const = 0; |
+ virtual base::string16 GetInfo(const AutofillType& type) const = 0; |
// Returns the icon, if any, that represents this model. |
virtual gfx::Image GetIcon(); |
@@ -44,9 +44,15 @@ class DataModelWrapper { |
// out-param). |
virtual void FillInputs(DetailInputs* inputs); |
- // Returns text to display to the user to summarize this data source. The |
- // default implementation assumes this is an address. |
- virtual string16 GetDisplayText(); |
+ // Gets text to display to the user to summarize this data source. The |
+ // default implementation assumes this is an address. Both params are required |
+ // to be non-NULL and will be filled in with text that is vertically compact |
+ // (but may take up a lot of horizontal space) and horizontally compact (but |
+ // may take up a lot of vertical space) respectively. The return value will |
+ // be true and the outparams will be filled in only if the data represented is |
+ // complete and valid. |
+ virtual bool GetDisplayText(base::string16* vertically_compact, |
+ base::string16* horizontally_compact); |
// Fills in |form_structure| with the data that this model contains. |inputs| |
// and |comparator| are used to determine whether each field in the |
@@ -64,6 +70,10 @@ class DataModelWrapper { |
virtual void FillFormField(AutofillField* field) const; |
private: |
+ // Formats address data into a single string using |separator| between |
+ // fields. |
+ base::string16 GetAddressDisplayText(const base::string16& separator); |
+ |
DISALLOW_COPY_AND_ASSIGN(DataModelWrapper); |
}; |
@@ -74,7 +84,7 @@ class EmptyDataModelWrapper : public DataModelWrapper { |
EmptyDataModelWrapper(); |
virtual ~EmptyDataModelWrapper(); |
- virtual string16 GetInfo(const AutofillType& type) const OVERRIDE; |
+ virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE; |
protected: |
virtual void FillFormField(AutofillField* field) const OVERRIDE; |
@@ -88,7 +98,7 @@ class AutofillDataModelWrapper : public DataModelWrapper { |
AutofillDataModelWrapper(const AutofillDataModel* data_model, size_t variant); |
virtual ~AutofillDataModelWrapper(); |
- virtual string16 GetInfo(const AutofillType& type) const OVERRIDE; |
+ virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE; |
protected: |
virtual void FillFormField(AutofillField* field) const OVERRIDE; |
@@ -124,9 +134,10 @@ class AutofillCreditCardWrapper : public AutofillDataModelWrapper { |
explicit AutofillCreditCardWrapper(const CreditCard* card); |
virtual ~AutofillCreditCardWrapper(); |
- virtual string16 GetInfo(const AutofillType& type) const OVERRIDE; |
+ virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE; |
virtual gfx::Image GetIcon() OVERRIDE; |
- virtual string16 GetDisplayText() OVERRIDE; |
+ virtual bool GetDisplayText(base::string16* vertically_compact, |
+ base::string16* horizontally_compact) OVERRIDE; |
private: |
const CreditCard* card_; |
@@ -140,8 +151,9 @@ class WalletAddressWrapper : public DataModelWrapper { |
explicit WalletAddressWrapper(const wallet::Address* address); |
virtual ~WalletAddressWrapper(); |
- virtual string16 GetInfo(const AutofillType& type) const OVERRIDE; |
- virtual string16 GetDisplayText() OVERRIDE; |
+ virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE; |
+ virtual bool GetDisplayText(base::string16* vertically_compact, |
+ base::string16* horizontally_compact) OVERRIDE; |
private: |
const wallet::Address* address_; |
@@ -156,9 +168,10 @@ class WalletInstrumentWrapper : public DataModelWrapper { |
const wallet::WalletItems::MaskedInstrument* instrument); |
virtual ~WalletInstrumentWrapper(); |
- virtual string16 GetInfo(const AutofillType& type) const OVERRIDE; |
+ virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE; |
virtual gfx::Image GetIcon() OVERRIDE; |
- virtual string16 GetDisplayText() OVERRIDE; |
+ virtual bool GetDisplayText(base::string16* vertically_compact, |
+ base::string16* horizontally_compact) OVERRIDE; |
private: |
const wallet::WalletItems::MaskedInstrument* instrument_; |
@@ -172,8 +185,9 @@ class FullWalletBillingWrapper : public DataModelWrapper { |
explicit FullWalletBillingWrapper(wallet::FullWallet* full_wallet); |
virtual ~FullWalletBillingWrapper(); |
- virtual string16 GetInfo(const AutofillType& type) const OVERRIDE; |
- virtual string16 GetDisplayText() OVERRIDE; |
+ virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE; |
+ virtual bool GetDisplayText(base::string16* vertically_compact, |
+ base::string16* horizontally_compact) OVERRIDE; |
private: |
wallet::FullWallet* full_wallet_; |
@@ -187,7 +201,7 @@ class FullWalletShippingWrapper : public DataModelWrapper { |
explicit FullWalletShippingWrapper(wallet::FullWallet* full_wallet); |
virtual ~FullWalletShippingWrapper(); |
- virtual string16 GetInfo(const AutofillType& type) const OVERRIDE; |
+ virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE; |
private: |
wallet::FullWallet* full_wallet_; |