| OLD | NEW |
| 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 CHROME_BROWSER_AUTOFILL_AUTOFILL_COUNTRY_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_COUNTRY_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_COUNTRY_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_COUNTRY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // mapping from the locale is available. | 29 // mapping from the locale is available. |
| 30 static const std::string CountryCodeForLocale(const std::string& locale); | 30 static const std::string CountryCodeForLocale(const std::string& locale); |
| 31 | 31 |
| 32 // Returns the country code corresponding to |country|, which should be a | 32 // Returns the country code corresponding to |country|, which should be a |
| 33 // country code or country name localized to |locale|. This function can | 33 // country code or country name localized to |locale|. This function can |
| 34 // be expensive so use judiciously. | 34 // be expensive so use judiciously. |
| 35 static const std::string GetCountryCode(const string16& country, | 35 static const std::string GetCountryCode(const string16& country, |
| 36 const std::string& locale); | 36 const std::string& locale); |
| 37 | 37 |
| 38 // Returns the application locale. | 38 // Returns the application locale. |
| 39 // The first time this is called, it should be called from the UI thread. |
| 40 // Once [ http://crbug.com/100845 ] is fixed, this method should *only* be |
| 41 // called from the UI thread. |
| 39 static const std::string ApplicationLocale(); | 42 static const std::string ApplicationLocale(); |
| 40 | 43 |
| 41 const std::string country_code() const { return country_code_; } | 44 const std::string country_code() const { return country_code_; } |
| 42 const string16 name() const { return name_; } | 45 const string16 name() const { return name_; } |
| 43 const string16 postal_code_label() const { return postal_code_label_; } | 46 const string16 postal_code_label() const { return postal_code_label_; } |
| 44 const string16 state_label() const { return state_label_; } | 47 const string16 state_label() const { return state_label_; } |
| 45 | 48 |
| 46 private: | 49 private: |
| 47 AutofillCountry(const std::string& country_code, | 50 AutofillCountry(const std::string& country_code, |
| 48 const string16& name, | 51 const string16& name, |
| 49 const string16& postal_code_label, | 52 const string16& postal_code_label, |
| 50 const string16& state_label); | 53 const string16& state_label); |
| 51 | 54 |
| 52 // The two-letter ISO-3166 country code. | 55 // The two-letter ISO-3166 country code. |
| 53 std::string country_code_; | 56 std::string country_code_; |
| 54 | 57 |
| 55 // The country's name, localized to the app locale. | 58 // The country's name, localized to the app locale. |
| 56 string16 name_; | 59 string16 name_; |
| 57 | 60 |
| 58 // The localized label for the postal code (or zip code) field. | 61 // The localized label for the postal code (or zip code) field. |
| 59 string16 postal_code_label_; | 62 string16 postal_code_label_; |
| 60 | 63 |
| 61 // The localized label for the state (or province, district, etc.) field. | 64 // The localized label for the state (or province, district, etc.) field. |
| 62 string16 state_label_; | 65 string16 state_label_; |
| 63 | 66 |
| 64 DISALLOW_COPY_AND_ASSIGN(AutofillCountry); | 67 DISALLOW_COPY_AND_ASSIGN(AutofillCountry); |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_COUNTRY_H_ | 70 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_COUNTRY_H_ |
| OLD | NEW |