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 #include "chrome/browser/ui/autofill/data_model_wrapper.h" | 5 #include "chrome/browser/ui/autofill/data_model_wrapper.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" | 9 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" |
10 #include "components/autofill/browser/autofill_country.h" | 10 #include "components/autofill/browser/autofill_country.h" |
11 #include "components/autofill/browser/autofill_profile.h" | 11 #include "components/autofill/browser/autofill_profile.h" |
12 #include "components/autofill/browser/autofill_type.h" | 12 #include "components/autofill/browser/autofill_type.h" |
13 #include "components/autofill/browser/credit_card.h" | 13 #include "components/autofill/browser/credit_card.h" |
14 #include "components/autofill/browser/form_group.h" | 14 #include "components/autofill/browser/form_group.h" |
15 #include "components/autofill/browser/form_structure.h" | 15 #include "components/autofill/browser/form_structure.h" |
16 #include "components/autofill/browser/wallet/full_wallet.h" | 16 #include "components/autofill/browser/wallet/full_wallet.h" |
17 #include "components/autofill/browser/wallet/wallet_address.h" | 17 #include "components/autofill/browser/wallet/wallet_address.h" |
18 #include "components/autofill/browser/wallet/wallet_items.h" | 18 #include "components/autofill/browser/wallet/wallet_items.h" |
19 #include "ui/base/resource/resource_bundle.h" | 19 #include "ui/base/resource/resource_bundle.h" |
20 #include "ui/gfx/image/image.h" | 20 #include "ui/gfx/image/image.h" |
21 | 21 |
22 namespace autofill { | 22 namespace autofill { |
23 | 23 |
| 24 DataModelWrapper::DataModelWrapper() {} |
24 DataModelWrapper::~DataModelWrapper() {} | 25 DataModelWrapper::~DataModelWrapper() {} |
25 | 26 |
26 string16 DataModelWrapper::GetDisplayText() { | 27 string16 DataModelWrapper::GetDisplayText() { |
27 string16 comma = ASCIIToUTF16(", "); | 28 string16 comma = ASCIIToUTF16(", "); |
28 string16 label = GetInfo(NAME_FULL) + comma + GetInfo(ADDRESS_HOME_LINE1); | 29 string16 label = GetInfo(NAME_FULL) + comma + GetInfo(ADDRESS_HOME_LINE1); |
29 string16 address2 = GetInfo(ADDRESS_HOME_LINE2); | 30 string16 address2 = GetInfo(ADDRESS_HOME_LINE2); |
30 if (!address2.empty()) | 31 if (!address2.empty()) |
31 label += comma + address2; | 32 label += comma + address2; |
32 label += ASCIIToUTF16("\n") + | 33 label += ASCIIToUTF16("\n") + |
33 GetInfo(ADDRESS_HOME_CITY) + comma + | 34 GetInfo(ADDRESS_HOME_CITY) + comma + |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 DCHECK(full_wallet_); | 202 DCHECK(full_wallet_); |
202 } | 203 } |
203 | 204 |
204 FullWalletShippingWrapper::~FullWalletShippingWrapper() {} | 205 FullWalletShippingWrapper::~FullWalletShippingWrapper() {} |
205 | 206 |
206 string16 FullWalletShippingWrapper::GetInfo(AutofillFieldType type) { | 207 string16 FullWalletShippingWrapper::GetInfo(AutofillFieldType type) { |
207 return full_wallet_->shipping_address()->GetInfo(type); | 208 return full_wallet_->shipping_address()->GetInfo(type); |
208 } | 209 } |
209 | 210 |
210 } // namespace autofill | 211 } // namespace autofill |
OLD | NEW |