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

Side by Side Diff: components/payments/core/payment_instrument.h

Issue 2913223002: Make payment instrument labels dynamic (Closed)
Patch Set: Created 3 years, 6 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_PAYMENTS_CORE_PAYMENT_INSTRUMENT_H_ 5 #ifndef COMPONENTS_PAYMENTS_CORE_PAYMENT_INSTRUMENT_H_
6 #define COMPONENTS_PAYMENTS_CORE_PAYMENT_INSTRUMENT_H_ 6 #define COMPONENTS_PAYMENTS_CORE_PAYMENT_INSTRUMENT_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 29 matching lines...) Expand all
40 // without further editing. 40 // without further editing.
41 virtual bool IsCompleteForPayment() = 0; 41 virtual bool IsCompleteForPayment() = 0;
42 // Returns a message to indicate to the user what's missing for the instrument 42 // Returns a message to indicate to the user what's missing for the instrument
43 // to be complete for payment. 43 // to be complete for payment.
44 virtual base::string16 GetMissingInfoLabel() = 0; 44 virtual base::string16 GetMissingInfoLabel() = 0;
45 // Returns whether the instrument is valid for the purposes of responding to 45 // Returns whether the instrument is valid for the purposes of responding to
46 // canMakePayment. 46 // canMakePayment.
47 virtual bool IsValidForCanMakePayment() = 0; 47 virtual bool IsValidForCanMakePayment() = 0;
48 // Records the use of this payment instrument. 48 // Records the use of this payment instrument.
49 virtual void RecordUse() = 0; 49 virtual void RecordUse() = 0;
50 // Return the sub/label of payment instrument, to be displayed to the user.
51 virtual base::string16 GetLabel() const = 0;
52 virtual base::string16 GetSublabel() const = 0;
50 53
51 const std::string& method_name() const { return method_name_; } 54 const std::string& method_name() const { return method_name_; }
52 const base::string16& label() const { return label_; }
53 const base::string16& sublabel() const { return sublabel_; }
54 int icon_resource_id() const { return icon_resource_id_; } 55 int icon_resource_id() const { return icon_resource_id_; }
55 Type type() { return type_; } 56 Type type() { return type_; }
56 57
57 protected: 58 protected:
58 PaymentInstrument(const std::string& method_name, 59 PaymentInstrument(const std::string& method_name,
59 const base::string16& label,
60 const base::string16& sublabel,
61 int icon_resource_id, 60 int icon_resource_id,
62 Type type); 61 Type type);
63 62
64 private: 63 private:
65 const std::string method_name_; 64 const std::string method_name_;
66 const base::string16 label_;
67 const base::string16 sublabel_;
68 int icon_resource_id_; 65 int icon_resource_id_;
69 Type type_; 66 Type type_;
70 67
71 DISALLOW_COPY_AND_ASSIGN(PaymentInstrument); 68 DISALLOW_COPY_AND_ASSIGN(PaymentInstrument);
72 }; 69 };
73 70
74 } // namespace payments 71 } // namespace payments
75 72
76 #endif // COMPONENTS_PAYMENTS_CORE_PAYMENT_INSTRUMENT_H_ 73 #endif // COMPONENTS_PAYMENTS_CORE_PAYMENT_INSTRUMENT_H_
OLDNEW
« no previous file with comments | « components/payments/core/autofill_payment_instrument.cc ('k') | components/payments/core/payment_instrument.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698