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

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

Issue 12815002: requestAutocomplete: Fill |form_structure_| from Online Wallet data (including (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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 d4a5c8a5ff648667363b482d5c14aaa327f5192f..22a6ea61d41d8cd7524fb91863310e2e06a4e640 100644
--- a/chrome/browser/ui/autofill/data_model_wrapper.h
+++ b/chrome/browser/ui/autofill/data_model_wrapper.h
@@ -20,12 +20,13 @@ namespace gfx {
class Image;
}
+namespace autofill {
+
namespace wallet {
class Address;
+class FullWallet;
}
-namespace autofill {
-
// A glue class that allows uniform interactions with autocomplete data sources,
// regardless of their type. Implementations are intended to be lightweight and
// copyable, only holding weak references to their backing model.
@@ -41,7 +42,7 @@ class DataModelWrapper {
// Fills in |inputs| with the data that this model contains (|inputs| is an
// out-param).
- virtual void FillInputs(DetailInputs* inputs) = 0;
+ 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.
@@ -116,7 +117,6 @@ class WalletAddressWrapper : public DataModelWrapper {
virtual string16 GetInfo(AutofillFieldType type) OVERRIDE;
virtual gfx::Image GetIcon() OVERRIDE;
- virtual void FillInputs(DetailInputs* inputs) OVERRIDE;
protected:
virtual void FillFormField(AutofillField* field) OVERRIDE;
@@ -134,7 +134,6 @@ class WalletInstrumentWrapper : public DataModelWrapper {
virtual string16 GetInfo(AutofillFieldType type) OVERRIDE;
virtual gfx::Image GetIcon() OVERRIDE;
- virtual void FillInputs(DetailInputs* inputs) OVERRIDE;
virtual string16 GetDisplayText() OVERRIDE;
protected:
@@ -144,6 +143,37 @@ class WalletInstrumentWrapper : public DataModelWrapper {
const wallet::WalletItems::MaskedInstrument* instrument_;
};
-}
+// A DataModelWrapper for FullWallets.
+class FullWalletWrapper : public DataModelWrapper {
+ public:
+ explicit FullWalletWrapper(wallet::FullWallet* full_wallet);
+ virtual ~FullWalletWrapper();
+
+ virtual string16 GetInfo(AutofillFieldType type) OVERRIDE;
+ virtual gfx::Image GetIcon() OVERRIDE;
+
+ protected:
+ virtual bool IsBillingWrapper() const = 0;
+ virtual void FillFormField(AutofillField* field) OVERRIDE;
+
+ private:
+ wallet::FullWallet* full_wallet_;
+};
+
+class FullWalletBillingWrapper : public FullWalletWrapper {
+ public:
+ explicit FullWalletBillingWrapper(wallet::FullWallet* full_wallet);
+ virtual ~FullWalletBillingWrapper();
+ virtual bool IsBillingWrapper() const OVERRIDE;
+};
+
+class FullWalletShippingWrapper : public FullWalletWrapper {
+ public:
+ explicit FullWalletShippingWrapper(wallet::FullWallet* full_wallet);
+ virtual ~FullWalletShippingWrapper();
+ virtual bool IsBillingWrapper() const OVERRIDE;
+};
+
+} // namespace autofill
#endif // CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_

Powered by Google App Engine
This is Rietveld 408576698