| 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 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "components/autofill/common/autofill_export.h" |
| 13 | 14 |
| 14 namespace autofill { | 15 namespace autofill { |
| 15 | 16 |
| 16 // The minimal required fields for an address to be complete for a given | 17 // The minimal required fields for an address to be complete for a given |
| 17 // country. | 18 // country. |
| 18 enum AddressRequiredFields { | 19 enum AddressRequiredFields { |
| 19 ADDRESS_REQUIRES_CITY = 1 << 0, | 20 ADDRESS_REQUIRES_CITY = 1 << 0, |
| 20 ADDRESS_REQUIRES_STATE = 1 << 1, | 21 ADDRESS_REQUIRES_STATE = 1 << 1, |
| 21 ADDRESS_REQUIRES_ZIP = 1 << 2, | 22 ADDRESS_REQUIRES_ZIP = 1 << 2, |
| 22 | 23 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 33 // Policy for countries that don't have city, state or zip requirements. | 34 // Policy for countries that don't have city, state or zip requirements. |
| 34 ADDRESS_REQUIRES_ADDRESS_LINE_1_ONLY = 0, | 35 ADDRESS_REQUIRES_ADDRESS_LINE_1_ONLY = 0, |
| 35 | 36 |
| 36 // Policy for countries for which we do not have information about valid | 37 // Policy for countries for which we do not have information about valid |
| 37 // address format. | 38 // address format. |
| 38 ADDRESS_REQUIREMENTS_UNKNOWN = ADDRESS_REQUIRES_CITY_STATE_ZIP, | 39 ADDRESS_REQUIREMENTS_UNKNOWN = ADDRESS_REQUIRES_CITY_STATE_ZIP, |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 // Stores data associated with a country. Strings are localized to the app | 42 // Stores data associated with a country. Strings are localized to the app |
| 42 // locale. | 43 // locale. |
| 43 class AutofillCountry { | 44 class AUTOFILL_EXPORT AutofillCountry { |
| 44 public: | 45 public: |
| 45 // Returns country data corresponding to the two-letter ISO code | 46 // Returns country data corresponding to the two-letter ISO code |
| 46 // |country_code|. | 47 // |country_code|. |
| 47 AutofillCountry(const std::string& country_code, const std::string& locale); | 48 AutofillCountry(const std::string& country_code, const std::string& locale); |
| 48 ~AutofillCountry(); | 49 ~AutofillCountry(); |
| 49 | 50 |
| 50 // Fills |country_codes| with a list of the available countries' codes. | 51 // Fills |country_codes| with a list of the available countries' codes. |
| 51 static void GetAvailableCountries( | 52 static void GetAvailableCountries( |
| 52 std::vector<std::string>* country_codes); | 53 std::vector<std::string>* country_codes); |
| 53 | 54 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 102 |
| 102 // Address requirement field codes for the country. | 103 // Address requirement field codes for the country. |
| 103 AddressRequiredFields address_required_fields_; | 104 AddressRequiredFields address_required_fields_; |
| 104 | 105 |
| 105 DISALLOW_COPY_AND_ASSIGN(AutofillCountry); | 106 DISALLOW_COPY_AND_ASSIGN(AutofillCountry); |
| 106 }; | 107 }; |
| 107 | 108 |
| 108 } // namespace autofill | 109 } // namespace autofill |
| 109 | 110 |
| 110 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_COUNTRY_H_ | 111 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_COUNTRY_H_ |
| OLD | NEW |