| 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_ADDRESS_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_ADDRESS_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_ADDRESS_H_ | 6 #define CHROME_BROWSER_AUTOFILL_ADDRESS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "chrome/browser/autofill/form_group.h" | 13 #include "chrome/browser/autofill/form_group.h" |
| 14 | 14 |
| 15 // A form group that stores address information. | 15 // A form group that stores address information. |
| 16 class Address : public FormGroup { | 16 class Address : public FormGroup { |
| 17 public: | 17 public: |
| 18 Address(); | 18 Address(); |
| 19 explicit Address(const Address& address); |
| 19 virtual ~Address(); | 20 virtual ~Address(); |
| 20 | 21 |
| 22 Address& operator=(const Address& address); |
| 23 |
| 21 // FormGroup: | 24 // FormGroup: |
| 22 virtual FormGroup* Clone() const; | |
| 23 virtual void GetPossibleFieldTypes(const string16& text, | 25 virtual void GetPossibleFieldTypes(const string16& text, |
| 24 FieldTypeSet* possible_types) const; | 26 FieldTypeSet* possible_types) const; |
| 25 virtual void GetAvailableFieldTypes(FieldTypeSet* available_types) const; | 27 virtual void GetAvailableFieldTypes(FieldTypeSet* available_types) const; |
| 26 virtual void FindInfoMatches(const AutofillType& type, | 28 virtual void FindInfoMatches(const AutofillType& type, |
| 27 const string16& info, | 29 const string16& info, |
| 28 std::vector<string16>* matched_text) const; | 30 std::vector<string16>* matched_text) const; |
| 29 virtual string16 GetFieldText(const AutofillType& type) const; | 31 virtual string16 GetFieldText(const AutofillType& type) const; |
| 30 virtual void SetInfo(const AutofillType& type, const string16& value); | 32 virtual void SetInfo(const AutofillType& type, const string16& value); |
| 31 | 33 |
| 32 const std::string& country_code() const { return country_code_; } | 34 const std::string& country_code() const { return country_code_; } |
| 33 void set_country_code(const std::string& country_code) { | 35 void set_country_code(const std::string& country_code) { |
| 34 country_code_ = country_code; | 36 country_code_ = country_code; |
| 35 } | 37 } |
| 36 | 38 |
| 37 // Sets all of the fields to the empty string. | 39 // Sets all of the fields to the empty string. |
| 38 void Clear(); | 40 void Clear(); |
| 39 | 41 |
| 40 private: | 42 private: |
| 41 // Vector of tokens in an address line. | 43 // Vector of tokens in an address line. |
| 42 typedef std::vector<string16> LineTokens; | 44 typedef std::vector<string16> LineTokens; |
| 43 | 45 |
| 44 explicit Address(const Address& address); | |
| 45 | |
| 46 void operator=(const Address& address); | |
| 47 | |
| 48 // Returns the localized country name corresponding to |country_code_|. | 46 // Returns the localized country name corresponding to |country_code_|. |
| 49 string16 Country() const; | 47 string16 Country() const; |
| 50 | 48 |
| 51 void set_line1(const string16& line1); | 49 void set_line1(const string16& line1); |
| 52 void set_line2(const string16& line2); | 50 void set_line2(const string16& line2); |
| 53 | 51 |
| 54 // Sets the |country_code_| based on |country|, which should be a localized | 52 // Sets the |country_code_| based on |country|, which should be a localized |
| 55 // country name. | 53 // country name. |
| 56 void SetCountry(const string16& country); | 54 void SetCountry(const string16& country); |
| 57 | 55 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 84 // The address. | 82 // The address. |
| 85 string16 line1_; | 83 string16 line1_; |
| 86 string16 line2_; | 84 string16 line2_; |
| 87 string16 city_; | 85 string16 city_; |
| 88 string16 state_; | 86 string16 state_; |
| 89 std::string country_code_; | 87 std::string country_code_; |
| 90 string16 zip_code_; | 88 string16 zip_code_; |
| 91 }; | 89 }; |
| 92 | 90 |
| 93 #endif // CHROME_BROWSER_AUTOFILL_ADDRESS_H_ | 91 #endif // CHROME_BROWSER_AUTOFILL_ADDRESS_H_ |
| OLD | NEW |