Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_AUTOFILL_WALLET_WALLET_ADDRESS_H_ | |
| 6 #define CHROME_BROWSER_AUTOFILL_WALLET_WALLET_ADDRESS_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 | |
| 12 namespace base { | |
| 13 class DictionaryValue; | |
| 14 } | |
| 15 | |
| 16 namespace wallet { | |
| 17 | |
| 18 class Address { | |
|
Albert Bodenhamer
2012/11/30 01:06:02
Autofill has a class very similar to this in chrom
ahutter
2012/12/01 04:06:50
Added a TODO
| |
| 19 public: | |
| 20 Address(); | |
| 21 // TODO(ahutter): do we need descriptive_name, is_post_box, | |
| 22 // is_minimal_address, is_valid, or is_default | |
| 23 Address(const std::string& country_name_code, | |
| 24 const std::string& recipient_name, | |
| 25 const std::string& address_line_1, | |
| 26 const std::string& address_line_2, | |
| 27 const std::string& locality_name, | |
| 28 const std::string& administrative_area_name, | |
| 29 const std::string& postal_code_number, | |
| 30 const std::string& phone_number, | |
| 31 const std::string& object_id); | |
| 32 ~Address(); | |
| 33 const std::string get_country_name_code() const { return country_name_code_; } | |
| 34 const std::string get_recipient_name() const { return recipient_name_; } | |
| 35 const std::string get_address_line_1() const { return address_line_1_; } | |
| 36 const std::string get_address_line_2() const { return address_line_2_; } | |
| 37 const std::string get_locality_name() const { return locality_name_; } | |
| 38 const std::string get_admin_area_name() const { | |
| 39 return administrative_area_name_; | |
| 40 } | |
| 41 const std::string get_postal_code_number() const { | |
| 42 return postal_code_number_; | |
| 43 } | |
| 44 const std::string get_phone_number() const { return phone_number_; } | |
| 45 const std::string get_object_id() const { return object_id_; } | |
| 46 | |
| 47 void set_country_name_code(const std::string& country_name_code) { | |
| 48 country_name_code_ = country_name_code; | |
| 49 } | |
| 50 void set_recipient_name(const std::string& recipient_name) { | |
| 51 recipient_name_ = recipient_name; | |
| 52 } | |
| 53 void set_address_line_1(const std::string& address_line_1) { | |
| 54 address_line_1_ = address_line_1; | |
| 55 } | |
| 56 void set_address_line_2(const std::string& address_line_2) { | |
| 57 address_line_2_ = address_line_2; | |
| 58 } | |
| 59 void set_locality_name(const std::string& locality_name) { | |
| 60 locality_name_ = locality_name; | |
| 61 } | |
| 62 void set_admin_area_name(const std::string& administrative_area_name) { | |
| 63 administrative_area_name_ = administrative_area_name; | |
| 64 } | |
| 65 void set_postal_code_number(const std::string& postal_code_number) { | |
| 66 postal_code_number_ = postal_code_number; | |
| 67 } | |
| 68 void set_phone_number(const std::string& phone_number) { | |
| 69 phone_number_ = phone_number; | |
| 70 } | |
| 71 void set_object_id(const std::string& object_id) { | |
| 72 object_id_ = object_id; | |
| 73 } | |
| 74 | |
| 75 // Returns null if input is invalid or a valid address that is selectable for | |
| 76 // Google Wallet use. Caller owns returned pointer. | |
| 77 static Address* CreateIdedAddress(base::DictionaryValue* dictionary); | |
| 78 // Returns null if input in invalid or a valid address that can only be used | |
| 79 // for displaying to the user. Caller owns returned pointer. | |
| 80 static Address* CreateDisplayAddress(base::DictionaryValue* dictionary); | |
| 81 bool operator==(const Address& other) const; | |
| 82 bool operator!=(const Address& other) const; | |
| 83 | |
| 84 private: | |
| 85 std::string country_name_code_; | |
| 86 std::string recipient_name_; | |
| 87 std::string address_line_1_; | |
| 88 std::string address_line_2_; | |
| 89 std::string locality_name_; | |
| 90 std::string administrative_area_name_; | |
| 91 std::string postal_code_number_; | |
| 92 std::string phone_number_; | |
| 93 std::string object_id_; | |
| 94 DISALLOW_COPY_AND_ASSIGN(Address); | |
| 95 }; | |
| 96 | |
| 97 } // end wallet namespace | |
| 98 | |
| 99 #endif // CHROME_BROWSER_AUTOFILL_WALLET_WALLET_ADDRESS_H_ | |
| OLD | NEW |