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

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

Issue 13488009: Remove application locale cache in autofill code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: 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 #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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 225
226 string16 Address::DisplayNameDetail() const { 226 string16 Address::DisplayNameDetail() const {
227 #if defined(OS_ANDROID) 227 #if defined(OS_ANDROID)
228 // TODO(aruslan): improve this stub implementation. 228 // TODO(aruslan): improve this stub implementation.
229 return address_line_1(); 229 return address_line_1();
230 #else 230 #else
231 return string16(); 231 return string16();
232 #endif 232 #endif
233 } 233 }
234 234
235 string16 Address::GetInfo(AutofillFieldType type) const { 235 string16 Address::GetInfo(AutofillFieldType type,
236 const std::string& app_locale) const {
236 switch (type) { 237 switch (type) {
237 case NAME_FULL: 238 case NAME_FULL:
238 return recipient_name(); 239 return recipient_name();
239 240
240 case ADDRESS_HOME_LINE1: 241 case ADDRESS_HOME_LINE1:
241 return address_line_1(); 242 return address_line_1();
242 243
243 case ADDRESS_HOME_LINE2: 244 case ADDRESS_HOME_LINE2:
244 return address_line_2(); 245 return address_line_2();
245 246
246 case ADDRESS_HOME_CITY: 247 case ADDRESS_HOME_CITY:
247 return locality_name(); 248 return locality_name();
248 249
249 case ADDRESS_HOME_STATE: 250 case ADDRESS_HOME_STATE:
250 return administrative_area_name(); 251 return administrative_area_name();
251 252
252 case ADDRESS_HOME_ZIP: 253 case ADDRESS_HOME_ZIP:
253 return postal_code_number(); 254 return postal_code_number();
254 255
255 case ADDRESS_HOME_COUNTRY: { 256 case ADDRESS_HOME_COUNTRY: {
256 AutofillCountry country(country_name_code(), 257 AutofillCountry country(country_name_code(), app_locale);
257 AutofillCountry::ApplicationLocale());
258 return country.name(); 258 return country.name();
259 } 259 }
260 260
261 case PHONE_HOME_WHOLE_NUMBER: 261 case PHONE_HOME_WHOLE_NUMBER:
262 return phone_number(); 262 return phone_number();
263 263
264 // TODO(estade): implement more. 264 // TODO(estade): implement more.
265 default: 265 default:
266 NOTREACHED(); 266 NOTREACHED();
267 return string16(); 267 return string16();
(...skipping 11 matching lines...) Expand all
279 phone_number_ == other.phone_number_ && 279 phone_number_ == other.phone_number_ &&
280 object_id_ == other.object_id_; 280 object_id_ == other.object_id_;
281 } 281 }
282 282
283 bool Address::operator!=(const Address& other) const { 283 bool Address::operator!=(const Address& other) const {
284 return !(*this == other); 284 return !(*this == other);
285 } 285 }
286 286
287 } // namespace wallet 287 } // namespace wallet
288 } // namespace autofill 288 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698