OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 10 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
11 #include "components/autofill/browser/field_types.h" | 11 #include "components/autofill/browser/field_types.h" |
12 #include "components/autofill/browser/wallet/wallet_items.h" | 12 #include "components/autofill/browser/wallet/wallet_items.h" |
13 | 13 |
14 class AutofillProfile; | 14 class AutofillProfile; |
15 class CreditCard; | 15 class CreditCard; |
16 class FormGroup; | 16 class FormGroup; |
17 class FormStructure; | 17 class FormStructure; |
18 | 18 |
19 namespace gfx { | 19 namespace gfx { |
20 class Image; | 20 class Image; |
21 } | 21 } |
22 | 22 |
23 namespace wallet { | |
24 class Address; | |
25 } | |
26 | |
27 namespace autofill { | 23 namespace autofill { |
28 | 24 |
25 namespace wallet { | |
26 class Address; | |
27 class FullWallet; | |
28 } | |
29 | |
29 // A glue class that allows uniform interactions with autocomplete data sources, | 30 // A glue class that allows uniform interactions with autocomplete data sources, |
30 // regardless of their type. Implementations are intended to be lightweight and | 31 // regardless of their type. Implementations are intended to be lightweight and |
31 // copyable, only holding weak references to their backing model. | 32 // copyable, only holding weak references to their backing model. |
32 class DataModelWrapper { | 33 class DataModelWrapper { |
33 public: | 34 public: |
34 virtual ~DataModelWrapper(); | 35 virtual ~DataModelWrapper(); |
35 | 36 |
36 // Returns the data for a specific autocomplete type. | 37 // Returns the data for a specific autocomplete type. |
37 virtual string16 GetInfo(AutofillFieldType type) = 0; | 38 virtual string16 GetInfo(AutofillFieldType type) = 0; |
38 | 39 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 virtual void FillInputs(DetailInputs* inputs) OVERRIDE; | 138 virtual void FillInputs(DetailInputs* inputs) OVERRIDE; |
138 virtual string16 GetDisplayText() OVERRIDE; | 139 virtual string16 GetDisplayText() OVERRIDE; |
139 | 140 |
140 protected: | 141 protected: |
141 virtual void FillFormField(AutofillField* field) OVERRIDE; | 142 virtual void FillFormField(AutofillField* field) OVERRIDE; |
142 | 143 |
143 private: | 144 private: |
144 const wallet::WalletItems::MaskedInstrument* instrument_; | 145 const wallet::WalletItems::MaskedInstrument* instrument_; |
145 }; | 146 }; |
146 | 147 |
148 /* | |
149 // A DataModelWrapper for FullWallets. | |
150 class FullWalletWrapper : public DataModelWrapper { | |
151 public: | |
152 explicit FullWalletWrapper(const wallet::FullWallet* full_wallet); | |
153 virtual ~FullWalletWrapper(); | |
154 | |
155 virtual string16 GetInfo(AutofillFieldType type) OVERRIDE; | |
Dan Beam
2013/03/13 01:43:57
this interface would need to differ
Evan Stade
2013/03/13 01:54:10
2 different wrappers
Dan Beam
2013/03/13 03:05:47
Done.
| |
156 virtual gfx::Image GetIcon() OVERRIDE; | |
157 virtual void FillInputs(DetailInputs* inputs) OVERRIDE; | |
158 | |
159 protected: | |
160 virtual void FillFormField(AutofillField* field) OVERRIDE; | |
161 | |
162 private: | |
163 const wallet::FullWallet* full_wallet_; | |
164 }; | |
165 */ | |
147 } | 166 } |
148 | 167 |
149 #endif // CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_ | 168 #endif // CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_ |
OLD | NEW |