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

Side by Side Diff: components/autofill/browser/autofill_country.h

Issue 13488009: Remove application locale cache in autofill code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_COUNTRY_H_ 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_COUNTRY_H_
6 #define COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_COUNTRY_H_ 6 #define COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_COUNTRY_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // Returns the likely country code for |locale|, or "US" as a fallback if no 52 // Returns the likely country code for |locale|, or "US" as a fallback if no
53 // mapping from the locale is available. 53 // mapping from the locale is available.
54 static const std::string CountryCodeForLocale(const std::string& locale); 54 static const std::string CountryCodeForLocale(const std::string& locale);
55 55
56 // Returns the country code corresponding to |country|, which should be a 56 // Returns the country code corresponding to |country|, which should be a
57 // country code or country name localized to |locale|. This function can 57 // country code or country name localized to |locale|. This function can
58 // be expensive so use judiciously. 58 // be expensive so use judiciously.
59 static const std::string GetCountryCode(const string16& country, 59 static const std::string GetCountryCode(const string16& country,
60 const std::string& locale); 60 const std::string& locale);
61 61
62 // Returns the application locale.
63 // The first time this is called, it should be called from the UI thread.
64 // Once [ http://crbug.com/100845 ] is fixed, this method should *only* be
65 // called from the UI thread.
66 static const std::string ApplicationLocale();
67
68 const std::string country_code() const { return country_code_; } 62 const std::string country_code() const { return country_code_; }
69 const string16 name() const { return name_; } 63 const string16 name() const { return name_; }
70 const string16 postal_code_label() const { return postal_code_label_; } 64 const string16 postal_code_label() const { return postal_code_label_; }
71 const string16 state_label() const { return state_label_; } 65 const string16 state_label() const { return state_label_; }
72 66
73 // City is expected in a complete address for this country. 67 // City is expected in a complete address for this country.
74 bool requires_city() const { 68 bool requires_city() const {
75 return (address_required_fields_ & ADDRESS_REQUIRES_CITY) != 0; 69 return (address_required_fields_ & ADDRESS_REQUIRES_CITY) != 0;
76 } 70 }
77 71
(...skipping 25 matching lines...) Expand all
103 // The localized label for the state (or province, district, etc.) field. 97 // The localized label for the state (or province, district, etc.) field.
104 string16 state_label_; 98 string16 state_label_;
105 99
106 // Address requirement field codes for the country. 100 // Address requirement field codes for the country.
107 AddressRequiredFields address_required_fields_; 101 AddressRequiredFields address_required_fields_;
108 102
109 DISALLOW_COPY_AND_ASSIGN(AutofillCountry); 103 DISALLOW_COPY_AND_ASSIGN(AutofillCountry);
110 }; 104 };
111 105
112 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_COUNTRY_H_ 106 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_COUNTRY_H_
OLDNEW
« no previous file with comments | « components/autofill/browser/autocomplete_history_manager_unittest.cc ('k') | components/autofill/browser/autofill_country.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698