12a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
22a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
32a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// found in the LICENSE file.
42a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
52a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#ifndef CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_
62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#define CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_
72a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
82a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/compiler_specific.h"
97d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "base/strings/string16.h"
102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/ui/autofill/autofill_dialog_types.h"
11868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "components/autofill/content/browser/wallet/wallet_items.h"
12d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#include "components/autofill/core/browser/field_types.h"
132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace gfx {
152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class Image;
162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}
172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace autofill {
192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
20c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)class AutofillDataModel;
21c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)class AutofillProfile;
223240926e260ce088908e02ac07a6cf7b0c0cbf44Ben Murdochclass AutofillType;
23c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)class CreditCard;
24c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)class FormStructure;
25c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace wallet {
272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class Address;
282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class FullWallet;
292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}
302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// A glue class that allows uniform interactions with autocomplete data sources,
322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// regardless of their type. Implementations are intended to be lightweight and
332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// copyable, only holding weak references to their backing model.
342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class DataModelWrapper {
352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) public:
362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual ~DataModelWrapper();
372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
38d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  // Fills in |inputs| with the data that this model contains (|inputs| is an
39d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  // out-param).
40d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  void FillInputs(DetailInputs* inputs);
41d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
424e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  // Returns the data for a specific autocomplete type in a format for filling
434e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  // into a web form.
44c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  virtual base::string16 GetInfo(const AutofillType& type) const = 0;
452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
464e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  // Returns the data for a specified type in a format optimized for displaying
474e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  // to the user.
484e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  virtual base::string16 GetInfoForDisplay(const AutofillType& type) const;
494e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Returns the icon, if any, that represents this model.
512a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual gfx::Image GetIcon();
522a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
53c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  // Gets text to display to the user to summarize this data source. The
54c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  // default implementation assumes this is an address. Both params are required
55c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  // to be non-NULL and will be filled in with text that is vertically compact
56c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  // (but may take up a lot of horizontal space) and horizontally compact (but
57c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  // may take up a lot of vertical space) respectively. The return value will
58c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  // be true and the outparams will be filled in only if the data represented is
59c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  // complete and valid.
60c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  virtual bool GetDisplayText(base::string16* vertically_compact,
61c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch                              base::string16* horizontally_compact);
622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
632a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Fills in |form_structure| with the data that this model contains. |inputs|
642a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // and |comparator| are used to determine whether each field in the
65868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // FormStructure should be filled in or left alone. Returns whether any fields
66868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // in |form_structure| were found to be matching.
67868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  bool FillFormStructure(
682a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      const DetailInputs& inputs,
692a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      const InputFieldComparator& compare,
70868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      FormStructure* form_structure) const;
712a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
722a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) protected:
73c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  DataModelWrapper();
74c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
75c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) private:
76c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  // Formats address data into a single string using |separator| between
77c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  // fields.
78c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  base::string16 GetAddressDisplayText(const base::string16& separator);
79c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch
80c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(DataModelWrapper);
812a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)};
822a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
83868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// A DataModelWrapper that does not hold data and does nothing when told to
84868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// fill in a form.
85868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)class EmptyDataModelWrapper : public DataModelWrapper {
86868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) public:
87868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmptyDataModelWrapper();
88868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual ~EmptyDataModelWrapper();
89868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
90c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE;
91868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
92868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) protected:
93868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(EmptyDataModelWrapper);
94868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)};
95868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
96d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)// A DataModelWrapper for Autofill profiles.
97d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)class AutofillProfileWrapper : public DataModelWrapper {
982a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) public:
99d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  explicit AutofillProfileWrapper(const AutofillProfile* profile);
100d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  AutofillProfileWrapper(const AutofillProfile* profile,
101d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)                         const AutofillType& variant_type,
102d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)                         size_t variant);
103d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  virtual ~AutofillProfileWrapper();
1042a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
105c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE;
1064e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  virtual base::string16 GetInfoForDisplay(const AutofillType& type) const
1074e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)      OVERRIDE;
1082a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1092a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) protected:
110d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  // Returns the variant that should be used when dealing with an element that
111d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  // has the given |type|.
112d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  size_t GetVariantForType(const AutofillType& type) const;
1132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) private:
1152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  const AutofillProfile* profile_;
116c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
117d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  // The profile variant. |variant_| describes which variant of |variant_group_|
118d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  // to use in the profile.
119d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  FieldTypeGroup variant_group_;
120d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  size_t variant_;
121d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)
122c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(AutofillProfileWrapper);
1232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)};
1242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
12558537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)// A DataModelWrapper specifically for shipping address profiles.
12658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)class AutofillShippingAddressWrapper : public AutofillProfileWrapper {
12758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) public:
128d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)  explicit AutofillShippingAddressWrapper(const AutofillProfile* profile);
12958537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)  virtual ~AutofillShippingAddressWrapper();
13058537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)
13158537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)  virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE;
13258537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)
13358537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) private:
13458537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(AutofillShippingAddressWrapper);
13558537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)};
13658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)
1372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// A DataModelWrapper specifically for Autofill CreditCard data.
138d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)class AutofillCreditCardWrapper : public DataModelWrapper {
1392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) public:
1402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  explicit AutofillCreditCardWrapper(const CreditCard* card);
1412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual ~AutofillCreditCardWrapper();
1422a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
143c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE;
1442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual gfx::Image GetIcon() OVERRIDE;
145c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  virtual bool GetDisplayText(base::string16* vertically_compact,
146c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch                              base::string16* horizontally_compact) OVERRIDE;
1472a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1482a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) private:
1492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  const CreditCard* card_;
150c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
151c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(AutofillCreditCardWrapper);
1522a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)};
1532a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// A DataModelWrapper for Wallet addresses.
1552a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class WalletAddressWrapper : public DataModelWrapper {
1562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) public:
1572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  explicit WalletAddressWrapper(const wallet::Address* address);
1582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual ~WalletAddressWrapper();
1592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
160c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE;
1614e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  virtual base::string16 GetInfoForDisplay(const AutofillType& type) const
1624e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)      OVERRIDE;
163c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  virtual bool GetDisplayText(base::string16* vertically_compact,
164c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch                              base::string16* horizontally_compact) OVERRIDE;
1652a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1662a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) private:
1672a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  const wallet::Address* address_;
168c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
169c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(WalletAddressWrapper);
1702a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)};
1712a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1722a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// A DataModelWrapper for Wallet instruments.
1732a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class WalletInstrumentWrapper : public DataModelWrapper {
1742a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) public:
1752a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  explicit WalletInstrumentWrapper(
1762a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)      const wallet::WalletItems::MaskedInstrument* instrument);
1772a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual ~WalletInstrumentWrapper();
1782a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
179c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE;
1804e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  virtual base::string16 GetInfoForDisplay(const AutofillType& type) const
1814e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)      OVERRIDE;
1822a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual gfx::Image GetIcon() OVERRIDE;
183c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  virtual bool GetDisplayText(base::string16* vertically_compact,
184c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch                              base::string16* horizontally_compact) OVERRIDE;
1852a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1862a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) private:
1872a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  const wallet::WalletItems::MaskedInstrument* instrument_;
188c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
189c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(WalletInstrumentWrapper);
1902a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)};
1912a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
192868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// A DataModelWrapper for FullWallet billing data.
1932a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class FullWalletBillingWrapper : public DataModelWrapper {
1942a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) public:
1952a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  explicit FullWalletBillingWrapper(wallet::FullWallet* full_wallet);
1962a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual ~FullWalletBillingWrapper();
1972a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
198c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE;
199c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  virtual bool GetDisplayText(base::string16* vertically_compact,
200c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch                              base::string16* horizontally_compact) OVERRIDE;
2012a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2022a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) private:
2032a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  wallet::FullWallet* full_wallet_;
204c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
205c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(FullWalletBillingWrapper);
2062a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)};
2072a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
208868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// A DataModelWrapper for FullWallet shipping data.
2092a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class FullWalletShippingWrapper : public DataModelWrapper {
2102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) public:
2112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  explicit FullWalletShippingWrapper(wallet::FullWallet* full_wallet);
2122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual ~FullWalletShippingWrapper();
2132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
214c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch  virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE;
2152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) private:
2172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  wallet::FullWallet* full_wallet_;
218c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
219c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(FullWalletShippingWrapper);
2202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)};
2212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
222eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// A DataModelWrapper to copy the output of one section to the input of another.
223f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)class FieldMapWrapper : public DataModelWrapper {
224eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch public:
225f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  explicit FieldMapWrapper(const FieldValueMap& field_map);
226f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual ~FieldMapWrapper();
227eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
2283240926e260ce088908e02ac07a6cf7b0c0cbf44Ben Murdoch  virtual base::string16 GetInfo(const AutofillType& type) const OVERRIDE;
229eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
230eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch private:
231f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  const FieldValueMap& field_map_;
232eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
233f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(FieldMapWrapper);
234eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch};
235eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
2362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}  // namespace autofill
2372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif  // CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_
239