| OLD | NEW | 
|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CORE_BROWSER_ADDRESS_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_H_ | 
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_H_ | 
| 7 | 7 | 
| 8 #include <string> | 8 #include <string> | 
| 9 #include <vector> | 9 #include <vector> | 
| 10 | 10 | 
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" | 
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" | 
| 13 #include "components/autofill/core/browser/form_group.h" | 13 #include "components/autofill/core/browser/form_group.h" | 
| 14 | 14 | 
| 15 namespace autofill { | 15 namespace autofill { | 
| 16 | 16 | 
| 17 // A form group that stores address information. | 17 // A form group that stores address information. | 
| 18 class Address : public FormGroup { | 18 class Address : public FormGroup { | 
| 19  public: | 19  public: | 
| 20   Address(); | 20   Address(); | 
| 21   Address(const Address& address); | 21   Address(const Address& address); | 
| 22   virtual ~Address(); | 22   virtual ~Address(); | 
| 23 | 23 | 
| 24   Address& operator=(const Address& address); | 24   Address& operator=(const Address& address); | 
| 25 | 25 | 
| 26   // FormGroup: | 26   // FormGroup: | 
| 27   virtual base::string16 GetRawInfo(ServerFieldType type) const OVERRIDE; | 27   virtual base::string16 GetRawInfo(ServerFieldType type) const override; | 
| 28   virtual void SetRawInfo(ServerFieldType type, | 28   virtual void SetRawInfo(ServerFieldType type, | 
| 29                           const base::string16& value) OVERRIDE; | 29                           const base::string16& value) override; | 
| 30   virtual base::string16 GetInfo(const AutofillType& type, | 30   virtual base::string16 GetInfo(const AutofillType& type, | 
| 31                            const std::string& app_locale) const OVERRIDE; | 31                            const std::string& app_locale) const override; | 
| 32   virtual bool SetInfo(const AutofillType& type, | 32   virtual bool SetInfo(const AutofillType& type, | 
| 33                        const base::string16& value, | 33                        const base::string16& value, | 
| 34                        const std::string& app_locale) OVERRIDE; | 34                        const std::string& app_locale) override; | 
| 35   virtual void GetMatchingTypes( | 35   virtual void GetMatchingTypes( | 
| 36       const base::string16& text, | 36       const base::string16& text, | 
| 37       const std::string& app_locale, | 37       const std::string& app_locale, | 
| 38       ServerFieldTypeSet* matching_types) const OVERRIDE; | 38       ServerFieldTypeSet* matching_types) const override; | 
| 39 | 39 | 
| 40  private: | 40  private: | 
| 41   // FormGroup: | 41   // FormGroup: | 
| 42   virtual void GetSupportedTypes( | 42   virtual void GetSupportedTypes( | 
| 43       ServerFieldTypeSet* supported_types) const OVERRIDE; | 43       ServerFieldTypeSet* supported_types) const override; | 
| 44 | 44 | 
| 45   // Trims any trailing newlines from |street_address_|. | 45   // Trims any trailing newlines from |street_address_|. | 
| 46   void TrimStreetAddress(); | 46   void TrimStreetAddress(); | 
| 47 | 47 | 
| 48   // The lines of the street address. | 48   // The lines of the street address. | 
| 49   std::vector<base::string16> street_address_; | 49   std::vector<base::string16> street_address_; | 
| 50   // A subdivision of city, e.g. inner-city district or suburb. | 50   // A subdivision of city, e.g. inner-city district or suburb. | 
| 51   base::string16 dependent_locality_; | 51   base::string16 dependent_locality_; | 
| 52   base::string16 city_; | 52   base::string16 city_; | 
| 53   base::string16 state_; | 53   base::string16 state_; | 
| 54   base::string16 zip_code_; | 54   base::string16 zip_code_; | 
| 55   // Similar to a ZIP code, but used by entities that might not be | 55   // Similar to a ZIP code, but used by entities that might not be | 
| 56   // geographically contiguous.  The canonical example is CEDEX in France. | 56   // geographically contiguous.  The canonical example is CEDEX in France. | 
| 57   base::string16 sorting_code_; | 57   base::string16 sorting_code_; | 
| 58 | 58 | 
| 59   // The ISO 3166 2-letter country code, or an empty string if there is no | 59   // The ISO 3166 2-letter country code, or an empty string if there is no | 
| 60   // country data specified for this address. | 60   // country data specified for this address. | 
| 61   std::string country_code_; | 61   std::string country_code_; | 
| 62 }; | 62 }; | 
| 63 | 63 | 
| 64 }  // namespace autofill | 64 }  // namespace autofill | 
| 65 | 65 | 
| 66 #endif  // COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_H_ | 66 #endif  // COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_H_ | 
| OLD | NEW | 
|---|