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

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

Issue 2805263003: [Payments] Selecting incomplete items will open editors (Closed)
Patch Set: fix ios test for realz Created 3 years, 8 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 7b3d0e0078406b5c519e96053ff6ccc5732a28d6..5d70847f4f273358ce06978c94fb60caf22e148d 100644
--- a/components/payments/core/payment_instrument.h
+++ b/components/payments/core/payment_instrument.h
@@ -16,6 +16,9 @@ namespace payments {
// Base class which represents a form of payment in Payment Request.
class PaymentInstrument {
public:
+ // The type of this instrument instance.
+ enum class Type { AUTOFILL };
+
class Delegate {
public:
virtual ~Delegate() {}
@@ -33,25 +36,32 @@ class PaymentInstrument {
// Will call into the |delegate| (can't be null) on success or error.
virtual void InvokePaymentApp(Delegate* delegate) = 0;
- // Returns true if the card is valid to be used as a payment method.
- virtual bool IsValid() = 0;
+ // Returns whether the instrument is complete to be used as a payment method
+ // without further editing.
+ virtual bool IsCompleteForPayment() = 0;
+ // Returns whether the instrument is valid for the purposes of responding to
+ // canMakePayment.
+ virtual bool IsValidForCanMakePayment() = 0;
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() const { return icon_resource_id_; }
+ Type type() { return type_; }
protected:
PaymentInstrument(const std::string& method_name,
const base::string16& label,
const base::string16& sublabel,
- int icon_resource_id);
+ int icon_resource_id,
+ Type type);
private:
const std::string method_name_;
const base::string16 label_;
const base::string16 sublabel_;
int icon_resource_id_;
+ Type type_;
DISALLOW_COPY_AND_ASSIGN(PaymentInstrument);
};
« no previous file with comments | « components/payments/core/autofill_payment_instrument_unittest.cc ('k') | components/payments/core/payment_instrument.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698