| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_WALLET_WALLET_ADDRESS_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_WALLET_WALLET_ADDRESS_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_WALLET_WALLET_ADDRESS_H_ | 6 #define CHROME_BROWSER_AUTOFILL_WALLET_WALLET_ADDRESS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 scoped_ptr<base::DictionaryValue> ToDictionaryWithoutID() const; | 93 scoped_ptr<base::DictionaryValue> ToDictionaryWithoutID() const; |
| 94 | 94 |
| 95 // Returns a string that summarizes this address, suitable for display to | 95 // Returns a string that summarizes this address, suitable for display to |
| 96 // the user. | 96 // the user. |
| 97 string16 DisplayName() const; | 97 string16 DisplayName() const; |
| 98 | 98 |
| 99 // Returns data appropriate for |type|. | 99 // Returns data appropriate for |type|. |
| 100 string16 GetInfo(AutofillFieldType type) const; | 100 string16 GetInfo(AutofillFieldType type) const; |
| 101 | 101 |
| 102 // Returns an empty scoped_ptr if input is invalid or a valid address that is | 102 // Returns an empty scoped_ptr if input is invalid or a valid address that is |
| 103 // selectable for Google Wallet use. | 103 // selectable for Google Wallet use. Does not require "id" in |dictionary|. |
| 104 static scoped_ptr<Address> | 104 // IDs are not required for billing addresses. |
| 105 CreateAddressWithID(const base::DictionaryValue& dictionary); | 105 static scoped_ptr<Address> CreateAddress( |
| 106 const base::DictionaryValue& dictionary); |
| 107 |
| 108 // Returns an empty scoped_ptr if input is invalid or a valid address that is |
| 109 // selectable for Google Wallet use. Requires "id" in |dictionary|. IDs are |
| 110 // required for shipping addresses. |
| 111 static scoped_ptr<Address> CreateAddressWithID( |
| 112 const base::DictionaryValue& dictionary); |
| 106 | 113 |
| 107 // Returns an empty scoped_ptr if input in invalid or a valid address that | 114 // Returns an empty scoped_ptr if input in invalid or a valid address that |
| 108 // can only be used for displaying to the user. | 115 // can only be used for displaying to the user. |
| 109 static scoped_ptr<Address> | 116 static scoped_ptr<Address> CreateDisplayAddress( |
| 110 CreateDisplayAddress(const base::DictionaryValue& dictionary); | 117 const base::DictionaryValue& dictionary); |
| 111 | 118 |
| 112 bool operator==(const Address& other) const; | 119 bool operator==(const Address& other) const; |
| 113 bool operator!=(const Address& other) const; | 120 bool operator!=(const Address& other) const; |
| 114 | 121 |
| 115 private: | 122 private: |
| 116 // |country_name_code_| should be an ISO 3166-1-alpha-2 (two letter codes, as | 123 // |country_name_code_| should be an ISO 3166-1-alpha-2 (two letter codes, as |
| 117 // used in DNS). For example, "GB". | 124 // used in DNS). For example, "GB". |
| 118 std::string country_name_code_; | 125 std::string country_name_code_; |
| 119 | 126 |
| 120 // The recipient's name. For example "John Doe". | 127 // The recipient's name. For example "John Doe". |
| (...skipping 28 matching lines...) Expand all Loading... |
| 149 // Externalized Online Wallet id for this address. | 156 // Externalized Online Wallet id for this address. |
| 150 std::string object_id_; | 157 std::string object_id_; |
| 151 | 158 |
| 152 DISALLOW_COPY_AND_ASSIGN(Address); | 159 DISALLOW_COPY_AND_ASSIGN(Address); |
| 153 }; | 160 }; |
| 154 | 161 |
| 155 } // namespace wallet | 162 } // namespace wallet |
| 156 } // namespace autofill | 163 } // namespace autofill |
| 157 | 164 |
| 158 #endif // CHROME_BROWSER_AUTOFILL_WALLET_WALLET_ADDRESS_H_ | 165 #endif // CHROME_BROWSER_AUTOFILL_WALLET_WALLET_ADDRESS_H_ |
| OLD | NEW |