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

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

Issue 17970003: New encryption/escrow endpoints for Wallet (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No !! Created 7 years, 5 months 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 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 int expiration_year, 48 int expiration_year,
49 FormOfPayment form_of_payment, 49 FormOfPayment form_of_payment,
50 scoped_ptr<Address> address); 50 scoped_ptr<Address> address);
51 51
52 Instrument(const Instrument& instrument); 52 Instrument(const Instrument& instrument);
53 53
54 ~Instrument(); 54 ~Instrument();
55 55
56 scoped_ptr<base::DictionaryValue> ToDictionary() const; 56 scoped_ptr<base::DictionaryValue> ToDictionary() const;
57 57
58 // Users of this class should call IsValid to check that the inputs provided
59 // in the constructor were valid for use with Google Wallet.
60 bool IsValid() const;
61
62 const base::string16& primary_account_number() const { 58 const base::string16& primary_account_number() const {
63 return primary_account_number_; 59 return primary_account_number_;
64 } 60 }
65 const base::string16& card_verification_number() const { 61 const base::string16& card_verification_number() const {
66 return card_verification_number_; 62 return card_verification_number_;
67 } 63 }
68 int expiration_month() const { return expiration_month_; } 64 int expiration_month() const { return expiration_month_; }
69 int expiration_year() const { return expiration_year_; } 65 int expiration_year() const { return expiration_year_; }
70 const Address& address() const { return *address_; } 66 const Address* address() const { return address_.get(); }
71 FormOfPayment form_of_payment() const { return form_of_payment_; } 67 FormOfPayment form_of_payment() const { return form_of_payment_; }
72 const base::string16& last_four_digits() { return last_four_digits_; } 68 const base::string16& last_four_digits() { return last_four_digits_; }
69 const std::string& object_id() const { return object_id_; }
70 void set_object_id(const std::string& object_id) { object_id_ = object_id; }
73 71
74 private: 72 private:
75 void Init(); 73 void Init();
76 74
77 // |primary_account_number_| is expected to be \d{12-19}. 75 // |primary_account_number_| is expected to be \d{12-19}.
78 base::string16 primary_account_number_; 76 base::string16 primary_account_number_;
79 77
80 // |card_verification_number_| is expected to be \d{3-4}. 78 // |card_verification_number_| is expected to be \d{3-4}.
81 base::string16 card_verification_number_; 79 base::string16 card_verification_number_;
82 80
83 // |expiration month_| should be 1-12. 81 // |expiration month_| should be 1-12.
84 int expiration_month_; 82 int expiration_month_;
85 83
86 // |expiration_year_| should be a 4-digit year. 84 // |expiration_year_| should be a 4-digit year.
87 int expiration_year_; 85 int expiration_year_;
88 86
89 // The payment network of the instrument, e.g. Visa. 87 // The payment network of the instrument, e.g. Visa.
90 FormOfPayment form_of_payment_; 88 FormOfPayment form_of_payment_;
91 89
92 // The billing address of the instrument. 90 // The billing address of the instrument.
93 scoped_ptr<Address> address_; 91 scoped_ptr<Address> address_;
94 92
95 // The last four digits of |primary_account_number_|. 93 // The last four digits of |primary_account_number_|.
96 base::string16 last_four_digits_; 94 base::string16 last_four_digits_;
97 95
Dan Beam 2013/07/02 21:03:11 nit: doc
ahutter 2013/07/02 21:15:56 Done.
96 std::string object_id_;
97
98 DISALLOW_ASSIGN(Instrument); 98 DISALLOW_ASSIGN(Instrument);
99 }; 99 };
100 100
101 } // namespace wallet 101 } // namespace wallet
102 } // namespace autofill 102 } // namespace autofill
103 103
104 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_INSTRUMENT_H_ 104 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_INSTRUMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698