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

Side by Side Diff: chrome/browser/ui/autofill/data_model_wrapper.h

Issue 14096009: [Autofill] Split off AutofillDataModel as a subclass of FormData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Android compile Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 namespace gfx { 14 namespace gfx {
15 class Image; 15 class Image;
16 } 16 }
17 17
18 namespace autofill { 18 namespace autofill {
19 19
20 class AutofillDataModel;
20 class AutofillProfile; 21 class AutofillProfile;
21 class CreditCard; 22 class CreditCard;
22 class FormGroup;
23 class FormStructure; 23 class FormStructure;
24 24
25 namespace wallet { 25 namespace wallet {
26 class Address; 26 class Address;
27 class FullWallet; 27 class FullWallet;
28 } 28 }
29 29
30 // A glue class that allows uniform interactions with autocomplete data sources, 30 // A glue class that allows uniform interactions with autocomplete data sources,
31 // regardless of their type. Implementations are intended to be lightweight and 31 // regardless of their type. Implementations are intended to be lightweight and
32 // copyable, only holding weak references to their backing model. 32 // copyable, only holding weak references to their backing model.
(...skipping 27 matching lines...) Expand all
60 DataModelWrapper(); 60 DataModelWrapper();
61 61
62 // Fills in |field| with data from the model. 62 // Fills in |field| with data from the model.
63 virtual void FillFormField(AutofillField* field); 63 virtual void FillFormField(AutofillField* field);
64 64
65 private: 65 private:
66 DISALLOW_COPY_AND_ASSIGN(DataModelWrapper); 66 DISALLOW_COPY_AND_ASSIGN(DataModelWrapper);
67 }; 67 };
68 68
69 // A DataModelWrapper for Autofill data. 69 // A DataModelWrapper for Autofill data.
70 class AutofillFormGroupWrapper : public DataModelWrapper { 70 class AutofillDataModelWrapper : public DataModelWrapper {
71 public: 71 public:
72 AutofillFormGroupWrapper(const FormGroup* form_group, size_t variant); 72 AutofillDataModelWrapper(const AutofillDataModel* data_model, size_t variant);
73 virtual ~AutofillFormGroupWrapper(); 73 virtual ~AutofillDataModelWrapper();
74 74
75 virtual string16 GetInfo(AutofillFieldType type) OVERRIDE; 75 virtual string16 GetInfo(AutofillFieldType type) OVERRIDE;
76 76
77 protected: 77 protected:
78 virtual void FillFormField(AutofillField* field) OVERRIDE; 78 virtual void FillFormField(AutofillField* field) OVERRIDE;
79 79
80 size_t variant() const { return variant_; } 80 size_t variant() const { return variant_; }
81 81
82 private: 82 private:
83 const FormGroup* form_group_; 83 const AutofillDataModel* data_model_;
84 const size_t variant_; 84 const size_t variant_;
85 85
86 DISALLOW_COPY_AND_ASSIGN(AutofillFormGroupWrapper); 86 DISALLOW_COPY_AND_ASSIGN(AutofillDataModelWrapper);
87 }; 87 };
88 88
89 // A DataModelWrapper for Autofill profiles. 89 // A DataModelWrapper for Autofill profiles.
90 class AutofillProfileWrapper : public AutofillFormGroupWrapper { 90 class AutofillProfileWrapper : public AutofillDataModelWrapper {
91 public: 91 public:
92 AutofillProfileWrapper(const AutofillProfile* profile, size_t variant); 92 AutofillProfileWrapper(const AutofillProfile* profile, size_t variant);
93 virtual ~AutofillProfileWrapper(); 93 virtual ~AutofillProfileWrapper();
94 94
95 virtual void FillInputs(DetailInputs* inputs) OVERRIDE; 95 virtual void FillInputs(DetailInputs* inputs) OVERRIDE;
96 96
97 private: 97 private:
98 const AutofillProfile* profile_; 98 const AutofillProfile* profile_;
99 99
100 DISALLOW_COPY_AND_ASSIGN(AutofillProfileWrapper); 100 DISALLOW_COPY_AND_ASSIGN(AutofillProfileWrapper);
101 }; 101 };
102 102
103 // A DataModelWrapper specifically for Autofill CreditCard data. 103 // A DataModelWrapper specifically for Autofill CreditCard data.
104 class AutofillCreditCardWrapper : public AutofillFormGroupWrapper { 104 class AutofillCreditCardWrapper : public AutofillDataModelWrapper {
105 public: 105 public:
106 explicit AutofillCreditCardWrapper(const CreditCard* card); 106 explicit AutofillCreditCardWrapper(const CreditCard* card);
107 virtual ~AutofillCreditCardWrapper(); 107 virtual ~AutofillCreditCardWrapper();
108 108
109 virtual string16 GetInfo(AutofillFieldType type) OVERRIDE; 109 virtual string16 GetInfo(AutofillFieldType type) OVERRIDE;
110 virtual gfx::Image GetIcon() OVERRIDE; 110 virtual gfx::Image GetIcon() OVERRIDE;
111 virtual string16 GetDisplayText() OVERRIDE; 111 virtual string16 GetDisplayText() OVERRIDE;
112 112
113 protected: 113 protected:
114 virtual void FillFormField(AutofillField* field) OVERRIDE; 114 virtual void FillFormField(AutofillField* field) OVERRIDE;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 private: 175 private:
176 wallet::FullWallet* full_wallet_; 176 wallet::FullWallet* full_wallet_;
177 177
178 DISALLOW_COPY_AND_ASSIGN(FullWalletShippingWrapper); 178 DISALLOW_COPY_AND_ASSIGN(FullWalletShippingWrapper);
179 }; 179 };
180 180
181 } // namespace autofill 181 } // namespace autofill
182 182
183 #endif // CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_ 183 #endif // CHROME_BROWSER_UI_AUTOFILL_DATA_MODEL_WRAPPER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc ('k') | chrome/browser/ui/autofill/data_model_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698