| 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 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 // Fills |country_codes| with a list of the available countries' codes. | 24 // Fills |country_codes| with a list of the available countries' codes. |
| 25 static void GetAvailableCountries( | 25 static void GetAvailableCountries( |
| 26 std::vector<std::string>* country_codes); | 26 std::vector<std::string>* country_codes); |
| 27 | 27 |
| 28 // Returns the likely country code for |locale|, or "US" as a fallback if no | 28 // Returns the likely country code for |locale|, or "US" as a fallback if no |
| 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|. | 33 // country code or country name localized to |locale|. This function can |
| 34 // be expensive so use judiciously. |
| 34 static const std::string GetCountryCode(const string16& country, | 35 static const std::string GetCountryCode(const string16& country, |
| 35 const std::string& locale); | 36 const std::string& locale); |
| 36 | 37 |
| 37 // Returns the application locale. | 38 // Returns the application locale. |
| 38 static const std::string ApplicationLocale(); | 39 static const std::string ApplicationLocale(); |
| 39 | 40 |
| 40 const std::string country_code() const { return country_code_; } | 41 const std::string country_code() const { return country_code_; } |
| 41 const string16 name() const { return name_; } | 42 const string16 name() const { return name_; } |
| 42 const string16 postal_code_label() const { return postal_code_label_; } | 43 const string16 postal_code_label() const { return postal_code_label_; } |
| 43 const string16 state_label() const { return state_label_; } | 44 const string16 state_label() const { return state_label_; } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 57 // The localized label for the postal code (or zip code) field. | 58 // The localized label for the postal code (or zip code) field. |
| 58 string16 postal_code_label_; | 59 string16 postal_code_label_; |
| 59 | 60 |
| 60 // The localized label for the state (or province, district, etc.) field. | 61 // The localized label for the state (or province, district, etc.) field. |
| 61 string16 state_label_; | 62 string16 state_label_; |
| 62 | 63 |
| 63 DISALLOW_COPY_AND_ASSIGN(AutofillCountry); | 64 DISALLOW_COPY_AND_ASSIGN(AutofillCountry); |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_COUNTRY_H_ | 67 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_COUNTRY_H_ |
| OLD | NEW |