Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: components/autofill/content/browser/wallet/instrument.h

Issue 100743006: Fix DCHECK() when updating instruments with no phone number. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_CONTENT_BROWSER_WALLET_INSTRUMENT_H_ 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_INSTRUMENT_H_
6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_INSTRUMENT_H_ 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_INSTRUMENT_H_
7 7
8 #include <string> 8 #include <string>
9
9 #include "base/basictypes.h" 10 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
11 #include "base/strings/string16.h" 12 #include "base/strings/string16.h"
12 13
13 namespace base { 14 namespace base {
14 class DictionaryValue; 15 class DictionaryValue;
15 } 16 }
16 17
17 namespace autofill { 18 namespace autofill {
18 19
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } 61 }
61 const base::string16& card_verification_number() const { 62 const base::string16& card_verification_number() const {
62 return card_verification_number_; 63 return card_verification_number_;
63 } 64 }
64 int expiration_month() const { return expiration_month_; } 65 int expiration_month() const { return expiration_month_; }
65 int expiration_year() const { return expiration_year_; } 66 int expiration_year() const { return expiration_year_; }
66 const Address* address() const { return address_.get(); } 67 const Address* address() const { return address_.get(); }
67 FormOfPayment form_of_payment() const { return form_of_payment_; } 68 FormOfPayment form_of_payment() const { return form_of_payment_; }
68 const base::string16& last_four_digits() const { return last_four_digits_; } 69 const base::string16& last_four_digits() const { return last_four_digits_; }
69 const std::string& object_id() const { return object_id_; } 70 const std::string& object_id() const { return object_id_; }
71 bool expiration_differs_from_server() const {
72 return expiration_differs_from_server_;
73 }
70 void set_object_id(const std::string& object_id) { object_id_ = object_id; } 74 void set_object_id(const std::string& object_id) { object_id_ = object_id; }
75 void set_expiration_differs_from_server(bool expiration_differs_from_server) {
76 expiration_differs_from_server_ = expiration_differs_from_server;
77 }
71 78
72 private: 79 private:
73 void Init(); 80 void Init();
74 81
75 // |primary_account_number_| is expected to be \d{12-19}. 82 // |primary_account_number_| is expected to be \d{12-19}.
76 base::string16 primary_account_number_; 83 base::string16 primary_account_number_;
77 84
78 // |card_verification_number_| is expected to be \d{3-4}. 85 // |card_verification_number_| is expected to be \d{3-4}.
79 base::string16 card_verification_number_; 86 base::string16 card_verification_number_;
80 87
81 // |expiration month_| should be 1-12. 88 // |expiration month_| should be 1-12.
82 int expiration_month_; 89 int expiration_month_;
83 90
84 // |expiration_year_| should be a 4-digit year. 91 // |expiration_year_| should be a 4-digit year.
85 int expiration_year_; 92 int expiration_year_;
86 93
87 // The payment network of the instrument, e.g. Visa. 94 // The payment network of the instrument, e.g. Visa.
88 FormOfPayment form_of_payment_; 95 FormOfPayment form_of_payment_;
89 96
90 // The billing address of the instrument. 97 // The billing address of the instrument.
91 scoped_ptr<Address> address_; 98 scoped_ptr<Address> address_;
92 99
93 // The last four digits of |primary_account_number_|. 100 // The last four digits of |primary_account_number_|.
94 base::string16 last_four_digits_; 101 base::string16 last_four_digits_;
95 102
96 // Externalized Online Wallet id for this instrument. 103 // Externalized Online Wallet id for this instrument.
97 std::string object_id_; 104 std::string object_id_;
98 105
106 // Whether the expiration date differs from the server version of this
107 // instrument.
108 bool expiration_differs_from_server_;
109
99 DISALLOW_ASSIGN(Instrument); 110 DISALLOW_ASSIGN(Instrument);
100 }; 111 };
101 112
102 } // namespace wallet 113 } // namespace wallet
103 } // namespace autofill 114 } // namespace autofill
104 115
105 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_INSTRUMENT_H_ 116 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_INSTRUMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698