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

Side by Side Diff: components/autofill/browser/wallet/wallet_address.cc

Issue 12755019: Add 2-lines summary to CC/Address for Wallet items. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: SubLabel and sub-label -> Sublabel and sublabel. Added description. 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 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 #include "components/autofill/browser/wallet/wallet_address.h" 5 #include "components/autofill/browser/wallet/wallet_address.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "components/autofill/browser/autofill_country.h" 10 #include "components/autofill/browser/autofill_country.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 dict->SetString("recipient_name", recipient_name_); 207 dict->SetString("recipient_name", recipient_name_);
208 dict->SetString("locality_name", locality_name_); 208 dict->SetString("locality_name", locality_name_);
209 dict->SetString("administrative_area_name", 209 dict->SetString("administrative_area_name",
210 administrative_area_name_); 210 administrative_area_name_);
211 dict->SetString("postal_code_number", postal_code_number_); 211 dict->SetString("postal_code_number", postal_code_number_);
212 212
213 return dict.Pass(); 213 return dict.Pass();
214 } 214 }
215 215
216 string16 Address::DisplayName() const { 216 string16 Address::DisplayName() const {
217 // TODO(estade): improve this stub implementation. 217 #if defined(OS_ANDROID)
218 // TODO(aruslan): improve this stub implementation.
219 return recipient_name();
220 #else
221 // TODO(estade): improve this stub implementation + l10n.
218 return recipient_name() + ASCIIToUTF16(", ") + address_line_1(); 222 return recipient_name() + ASCIIToUTF16(", ") + address_line_1();
223 #endif
224 }
225
226 string16 Address::DisplayNameDetail() const {
227 #if defined(OS_ANDROID)
228 // TODO(aruslan): improve this stub implementation.
229 return address_line_1();
230 #else
231 return string16();
232 #endif
219 } 233 }
220 234
221 string16 Address::GetInfo(AutofillFieldType type) const { 235 string16 Address::GetInfo(AutofillFieldType type) const {
222 switch (type) { 236 switch (type) {
223 case NAME_FULL: 237 case NAME_FULL:
224 return recipient_name(); 238 return recipient_name();
225 239
226 case ADDRESS_HOME_LINE1: 240 case ADDRESS_HOME_LINE1:
227 return address_line_1(); 241 return address_line_1();
228 242
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 phone_number_ == other.phone_number_ && 279 phone_number_ == other.phone_number_ &&
266 object_id_ == other.object_id_; 280 object_id_ == other.object_id_;
267 } 281 }
268 282
269 bool Address::operator!=(const Address& other) const { 283 bool Address::operator!=(const Address& other) const {
270 return !(*this == other); 284 return !(*this == other);
271 } 285 }
272 286
273 } // namespace wallet 287 } // namespace wallet
274 } // namespace autofill 288 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698