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

Issue 2467393002: Add canMakeActivePayment() method to web payments. (Closed)

Created:
4 years, 1 month ago by please use gerrit instead
Modified:
4 years, 1 month ago
CC:
Aaron Boodman, abarth-chromium, agrieve+watch_chromium.org, blink-reviews, chromium-reviews, darin (slow to review), qsr+mojo_chromium.org, rouslan+payments_chromium.org, sebsg+paymentswatch_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add canMakeActivePayment() method to web payments. canMakeActivePayment() is a proposed function on PaymentRequest object. Proposal: https://github.com/zkoch/zkoch.github.io/blob/master/pr-detect-avail.md Example usage: pr.canMakeActivePayment() .then(result => { if (result) return pr.show(); }) .catch(error => { console.log(error); }); When canMakeActivePayment() is called, Chrome stores the website origin and the payment methods that it's checking in memory. That's shared across the whole browser, in global state. (Not storing this on disk, so the user can clear this data via browser restart.) Then Chrome starts a timer for 30 minutes. When the timer fires, Chrome removes that origin and the payment methods that it was checking from the list. If the same origin tries to check different payment methods within the 30 minute window, Chrome rejects that request. If canMakeActivePayment() is rejected, then pr.show() can still be called regardless. Intent to implement and ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/IoIxRpn6l9g/ux1C1Cj7AQAJ Tag review: https://github.com/w3ctag/spec-reviews/issues/146 OWP launch tracking bug: http://crbug.com/664619 Link to entry on the feature dashboard: https://www.chromestatus.com/feature/5702608073261056 The feature is behind chrome://flags/#enable-experimental-web-platform-features until it is approved to ship. BUG=662931, 664619 Committed: https://crrev.com/5132963daf4b866cc573b06ff8e84f9b6ec4534c Cr-Commit-Position: refs/heads/master@{#433164}

Patch Set 1 : Add canMakeActivePayment() method to web payments. #

Total comments: 3

Patch Set 2 : contextIsValid and global-interface-listing #

Total comments: 2

Patch Set 3 : ArrayMap and rebase #

Total comments: 4

Patch Set 4 : Address comments #

Patch Set 5 : Hide behind a flag #

Total comments: 4

Patch Set 6 : Rebase and change bool to boolean in IDL #

Patch Set 7 : Address comments #

Patch Set 8 : Address comments #

Patch Set 9 : Fix typo #

Patch Set 10 : Fix FindBugs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+821 lines, -56 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestFactory.java View 1 2 3 4 chunks +10 lines, -13 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java View 1 2 3 4 5 6 7 8 9 17 chunks +96 lines, -28 lines 0 comments Download
M chrome/android/java_sources.gni View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -0 lines 0 comments Download
A chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestActivePaymentQueryNoCardTest.java View 1 2 3 4 5 6 1 chunk +81 lines, -0 lines 0 comments Download
A chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestActivePaymentQueryTest.java View 1 2 3 4 5 6 1 chunk +86 lines, -0 lines 0 comments Download
A chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestCcActivePaymentQueryNoCardTest.java View 1 2 3 4 5 6 1 chunk +45 lines, -0 lines 0 comments Download
A chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestCcActivePaymentQueryTest.java View 1 2 3 4 5 6 1 chunk +65 lines, -0 lines 0 comments Download
A chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPaymentAppActivePaymentQueryTest.java View 1 2 3 4 5 6 1 chunk +71 lines, -0 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestBase.java View 1 2 3 4 5 3 chunks +8 lines, -0 lines 0 comments Download
A chrome/test/data/android/payments/active_payment_query.js View 1 chunk +28 lines, -0 lines 0 comments Download
A chrome/test/data/android/payments/active_payment_query_bobpay.js View 1 chunk +28 lines, -0 lines 0 comments Download
A chrome/test/data/android/payments/active_payment_query_cc.js View 1 chunk +48 lines, -0 lines 0 comments Download
A chrome/test/data/android/payments/payment_request_active_payment_query_bobpay_test.html View 1 chunk +20 lines, -0 lines 0 comments Download
A chrome/test/data/android/payments/payment_request_active_payment_query_cc_test.html View 1 chunk +20 lines, -0 lines 0 comments Download
A chrome/test/data/android/payments/payment_request_active_payment_query_test.html View 1 chunk +20 lines, -0 lines 0 comments Download
M components/payments/payment_request.mojom View 1 2 3 4 5 3 chunks +8 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/Source/modules/payments/ActivePaymentTest.cpp View 1 2 3 1 chunk +114 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/payments/PaymentRequest.h View 1 2 3 4 5 3 chunks +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/payments/PaymentRequest.cpp View 1 2 3 4 5 6 15 chunks +57 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/modules/payments/PaymentRequest.idl View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 88 (58 generated)
please use gerrit instead
mek@, ptal WebKit. ianwen@, ptal Java.
4 years, 1 month ago (2016-11-09 23:17:31 UTC) #17
please use gerrit instead
tsepez@, ptal payment_request.mojom.
4 years, 1 month ago (2016-11-09 23:19:44 UTC) #19
haraken
https://codereview.chromium.org/2467393002/diff/60001/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp File third_party/WebKit/Source/modules/payments/PaymentRequest.cpp (right): https://codereview.chromium.org/2467393002/diff/60001/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp#newcode532 third_party/WebKit/Source/modules/payments/PaymentRequest.cpp:532: !scriptState->domWindow() || !scriptState->domWindow()->frame()) { We normally check scriptState->contextIsValid().
4 years, 1 month ago (2016-11-10 01:54:45 UTC) #23
please use gerrit instead
https://codereview.chromium.org/2467393002/diff/60001/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp File third_party/WebKit/Source/modules/payments/PaymentRequest.cpp (right): https://codereview.chromium.org/2467393002/diff/60001/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp#newcode532 third_party/WebKit/Source/modules/payments/PaymentRequest.cpp:532: !scriptState->domWindow() || !scriptState->domWindow()->frame()) { On 2016/11/10 01:54:45, haraken wrote: ...
4 years, 1 month ago (2016-11-10 14:59:13 UTC) #26
Tom Sepez
mojom LGTM
4 years, 1 month ago (2016-11-10 16:53:45 UTC) #27
Ian Wen
I will still pass to dfalcantara since the java tests need to be approved by ...
4 years, 1 month ago (2016-11-10 20:21:50 UTC) #31
please use gerrit instead
On 2016/11/10 20:21:50, Ian Wen wrote: > I will still pass to dfalcantara since the ...
4 years, 1 month ago (2016-11-10 21:56:38 UTC) #34
Ian Wen
Oops, my extension failed me. lgtm java code, after comments. ;) https://codereview.chromium.org/2467393002/diff/100001/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java File chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java (right): ...
4 years, 1 month ago (2016-11-10 23:50:16 UTC) #38
Marijn Kruisselbrink
I don't understand what you mean with "This is a complete implementation of an additive ...
4 years, 1 month ago (2016-11-11 00:00:05 UTC) #39
please use gerrit instead
On 2016/11/11 00:00:05, Marijn Kruisselbrink wrote: > Any API change (new api, change to existing ...
4 years, 1 month ago (2016-11-11 21:11:50 UTC) #41
please use gerrit instead
https://codereview.chromium.org/2467393002/diff/100001/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java File chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java (right): https://codereview.chromium.org/2467393002/diff/100001/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java#newcode955 chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java:955: mHandler.postDelayed(new Runnable() { On 2016/11/10 23:50:15, Ian Wen wrote: ...
4 years, 1 month ago (2016-11-11 22:22:26 UTC) #43
haraken
On 2016/11/10 14:59:13, rouslan wrote: > https://codereview.chromium.org/2467393002/diff/60001/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp > File third_party/WebKit/Source/modules/payments/PaymentRequest.cpp (right): > > https://codereview.chromium.org/2467393002/diff/60001/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp#newcode532 > ...
4 years, 1 month ago (2016-11-12 01:27:35 UTC) #46
please use gerrit instead
On 2016/11/11 21:11:50, rouslan wrote: > Sent out an intent to implement and ship: > ...
4 years, 1 month ago (2016-11-15 16:16:30 UTC) #49
Marijn Kruisselbrink
On 2016/11/15 at 16:16:30, rouslan wrote: > On 2016/11/11 21:11:50, rouslan wrote: > > Sent ...
4 years, 1 month ago (2016-11-16 19:25:43 UTC) #50
Marijn Kruisselbrink
On 2016/11/15 at 16:16:30, rouslan wrote: > On 2016/11/11 21:11:50, rouslan wrote: > > Sent ...
4 years, 1 month ago (2016-11-16 19:25:43 UTC) #51
please use gerrit instead
Marijn, ptal patch 5. I've hidden the feature behind a flag and notified blink-dev: https://groups.google.com/a/chromium.org/d/msg/blink-dev/IoIxRpn6l9g/etSuMidkAAAJ
4 years, 1 month ago (2016-11-17 00:43:05 UTC) #54
Marijn Kruisselbrink
Two small questions around expected behavior from a spec point of view, but I imagine ...
4 years, 1 month ago (2016-11-17 18:06:21 UTC) #59
please use gerrit instead
Addressed the comments. Noted in CL description that the feature is behind a flag. Sending ...
4 years, 1 month ago (2016-11-17 20:07:21 UTC) #61
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2467393002/200001
4 years, 1 month ago (2016-11-17 20:10:04 UTC) #64
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2467393002/220001
4 years, 1 month ago (2016-11-17 20:30:56 UTC) #68
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/334271)
4 years, 1 month ago (2016-11-17 21:56:35 UTC) #70
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2467393002/220001
4 years, 1 month ago (2016-11-17 21:59:39 UTC) #72
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/338048)
4 years, 1 month ago (2016-11-17 22:35:34 UTC) #74
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2467393002/220001
4 years, 1 month ago (2016-11-17 22:43:12 UTC) #76
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/338146)
4 years, 1 month ago (2016-11-18 00:06:24 UTC) #78
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2467393002/240001
4 years, 1 month ago (2016-11-18 00:11:49 UTC) #81
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/275419)
4 years, 1 month ago (2016-11-18 06:08:29 UTC) #83
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2467393002/240001
4 years, 1 month ago (2016-11-18 09:30:47 UTC) #85
commit-bot: I haz the power
Committed patchset #10 (id:240001)
4 years, 1 month ago (2016-11-18 10:04:31 UTC) #86
commit-bot: I haz the power
4 years, 1 month ago (2016-11-18 10:06:54 UTC) #88
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/5132963daf4b866cc573b06ff8e84f9b6ec4534c
Cr-Commit-Position: refs/heads/master@{#433164}

Powered by Google App Engine
This is Rietveld 408576698