Chromium Code Reviews| 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 currently required or returns for billing addresses not in a |
|
ahutter
2013/03/04 21:35:52
"or returned for billing addresses."?
Dan Beam
2013/03/04 21:50:53
Done.
| |
| 105 CreateAddressWithID(const base::DictionaryValue& dictionary); | 105 // FullWallet. |
| 106 static scoped_ptr<Address> CreateAddress( | |
| 107 const base::DictionaryValue& dictionary); | |
| 108 | |
| 109 // Returns an empty scoped_ptr if input is invalid or a valid address that is | |
| 110 // selectable for Google Wallet use. Requires "id" in |dictionary|. IDs are | |
| 111 // required for shipping address and billing addresses in a FullWallet. | |
|
ahutter
2013/03/04 21:35:52
"required for shipping addresses."?
Dan Beam
2013/03/04 21:50:53
Done.
| |
| 112 static scoped_ptr<Address> CreateAddressWithID( | |
| 113 const base::DictionaryValue& dictionary); | |
| 106 | 114 |
| 107 // Returns an empty scoped_ptr if input in invalid or a valid address that | 115 // Returns an empty scoped_ptr if input in invalid or a valid address that |
| 108 // can only be used for displaying to the user. | 116 // can only be used for displaying to the user. |
| 109 static scoped_ptr<Address> | 117 static scoped_ptr<Address> CreateDisplayAddress( |
| 110 CreateDisplayAddress(const base::DictionaryValue& dictionary); | 118 const base::DictionaryValue& dictionary); |
| 111 | 119 |
| 112 bool operator==(const Address& other) const; | 120 bool operator==(const Address& other) const; |
| 113 bool operator!=(const Address& other) const; | 121 bool operator!=(const Address& other) const; |
| 114 | 122 |
| 115 private: | 123 private: |
| 116 // |country_name_code_| should be an ISO 3166-1-alpha-2 (two letter codes, as | 124 // |country_name_code_| should be an ISO 3166-1-alpha-2 (two letter codes, as |
| 117 // used in DNS). For example, "GB". | 125 // used in DNS). For example, "GB". |
| 118 std::string country_name_code_; | 126 std::string country_name_code_; |
| 119 | 127 |
| 120 // The recipient's name. For example "John Doe". | 128 // The recipient's name. For example "John Doe". |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 149 // Externalized Online Wallet id for this address. | 157 // Externalized Online Wallet id for this address. |
| 150 std::string object_id_; | 158 std::string object_id_; |
| 151 | 159 |
| 152 DISALLOW_COPY_AND_ASSIGN(Address); | 160 DISALLOW_COPY_AND_ASSIGN(Address); |
| 153 }; | 161 }; |
| 154 | 162 |
| 155 } // namespace wallet | 163 } // namespace wallet |
| 156 } // namespace autofill | 164 } // namespace autofill |
| 157 | 165 |
| 158 #endif // CHROME_BROWSER_AUTOFILL_WALLET_WALLET_ADDRESS_H_ | 166 #endif // CHROME_BROWSER_AUTOFILL_WALLET_WALLET_ADDRESS_H_ |
| OLD | NEW |