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

Unified Diff: components/payments/core/payment_instrument.h

Issue 2757523002: [Payments] Use PaymentInstrument/AutofillPaymentInstrument throughout. (Closed)
Patch Set: addressed comments Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: components/payments/core/payment_instrument.h
diff --git a/components/payments/core/payment_instrument.h b/components/payments/core/payment_instrument.h
index a9348d52225d405a6cb348772d98364325070a73..c3bc5091da0ee56985a576eb3fdfe3f93cd594b8 100644
--- a/components/payments/core/payment_instrument.h
+++ b/components/payments/core/payment_instrument.h
@@ -9,6 +9,7 @@
#include <string>
#include "base/macros.h"
+#include "base/strings/string16.h"
namespace payments {
@@ -28,19 +29,29 @@ class PaymentInstrument {
virtual void OnInstrumentDetailsError() = 0;
};
- virtual ~PaymentInstrument() {}
+ virtual ~PaymentInstrument();
// Will call into the |delegate| (can't be null) on success or error.
virtual void InvokePaymentApp(Delegate* delegate) = 0;
+ // Returns if the card is valid to be used as a payment method.
please use gerrit instead 2017/03/16 15:01:24 Add "true" after "Returns". (Or replace "if" with
+ virtual bool IsValid() = 0;
- const std::string& method_name() { return method_name_; }
+ const std::string& method_name() const { return method_name_; }
+ const base::string16& label() const { return label_; }
+ const base::string16& sublabel() const { return sublabel_; }
+ int icon_resource_id() { return icon_resource_id_; }
please use gerrit instead 2017/03/16 15:01:24 const this method as well, please.
protected:
- explicit PaymentInstrument(const std::string& method_name)
- : method_name_(method_name) {}
+ PaymentInstrument(const std::string& method_name,
+ const base::string16& label,
+ const base::string16& sublabel,
+ int icon_resource_id);
private:
const std::string method_name_;
+ const base::string16 label_;
+ const base::string16 sublabel_;
+ int icon_resource_id_;
DISALLOW_COPY_AND_ASSIGN(PaymentInstrument);
};
« 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