Add a delay to "PAY" button enabling to avoid tricking user into double-tapping an area on screen where the "PAY" button would appear. |
|||
Issue description^^^
,
Feb 6 2017
Hi rouslan@, is this bug first report by you? Could you provide more detail of the circumstance? As I know we do not process key event during animation and when processing payment.
,
Feb 6 2017
The PAY button should be disabled for 200ms from when PaymentRequestImpl.show() was called. So, PaymentRequestUI should have a boolean mInitialPayButtonDisabled = true. PaymentRequestUI.updatePayButtonEnabled() should check mInitialPayButtonDisabled. PaymentRequestUI.show() should start a 200ms timer (mHander.postDelayed) to set mInitialPayButtonDisabled = false and call updatePayButtonEnabled().
,
Feb 6 2017
But why would we do that? The 'pay' button is disabled at the very beginning until the user can make payment (https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java?rcl=753d0fd6e0a60c1f9a44215f40d98c13a4420d1f&l=602). What's the bad result if we don't do that?
,
Feb 6 2017
The Pay button might be enabled immediately if the user requests only Android Pay, for example. See https://googlechrome.github.io/samples/paymentrequest/android-pay/
,
Feb 6 2017
Yes, but we already have PeekingAnimator which takes 225ms (after PaymentRequestUI.show) and we do not accept pay click before it finishes. Do we intend to delay after that animation?
,
Feb 6 2017
In that case, it's sufficient to add a comment to the PeekingAnimator duration to say that it also serves the function of preventing the user from accidentally double-cliking on the page and thus authorizing and unwanted transaction.
,
Feb 6 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a3a75cb7e4842e3b2e8f9ccc964cc17622ed1d7e commit a3a75cb7e4842e3b2e8f9ccc964cc17622ed1d7e Author: gogerald <gogerald@chromium.org> Date: Mon Feb 06 22:27:20 2017 Add extra comments to explain implicit usage of the animation duration BUG= 685771 Review-Url: https://codereview.chromium.org/2675183004 Cr-Commit-Position: refs/heads/master@{#448415} [modify] https://crrev.com/a3a75cb7e4842e3b2e8f9ccc964cc17622ed1d7e/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java
,
Feb 6 2017
,
Jun 27 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by bugdroid1@chromium.org
, Jan 30 2017