3 years, 9 months ago
(2017-02-28 02:59:58 UTC)
#7
Dry run: This issue passed the CQ dry run.
anthonyvd
https://codereview.chromium.org/2715213005/diff/60001/chrome/browser/ui/views/payments/payment_request_dialog_view.cc File chrome/browser/ui/views/payments/payment_request_dialog_view.cc (right): https://codereview.chromium.org/2715213005/diff/60001/chrome/browser/ui/views/payments/payment_request_dialog_view.cc#newcode146 chrome/browser/ui/views/payments/payment_request_dialog_view.cc:146: void PaymentRequestDialogView::UpdatePayButtonState(bool enabled) { I don't think this pattern ...
3 years, 9 months ago
(2017-02-28 17:16:35 UTC)
#8
https://codereview.chromium.org/2715213005/diff/60001/chrome/browser/ui/views...
File chrome/browser/ui/views/payments/payment_request_dialog_view.cc (right):
https://codereview.chromium.org/2715213005/diff/60001/chrome/browser/ui/views...
chrome/browser/ui/views/payments/payment_request_dialog_view.cc:146: void
PaymentRequestDialogView::UpdatePayButtonState(bool enabled) {
I don't think this pattern is the way to go:
1. The Payment Sheet isn't the only one with a pay button
2. Multiple Sheets layered on top of each other might need to update their pay
button at the same time
3. Traversing the view hierarchy isn't expensive but it's also not free.
4. As your comment mentions, there are weird states where the dialog is closed
and PR calls this function
I would instead add an PaymentRequest::Observer that raises a
PaymentInformationChanged() event. View controllers can query PaymentRequest in
their implementation of the observer to determine the state of the pay button
and subscribe/unsubscribe themselves to avoid lifetime issues.
WDYT?
Mathieu
Have a look at this version? https://codereview.chromium.org/2715213005/diff/60001/chrome/browser/ui/views/payments/payment_request_dialog_view.cc File chrome/browser/ui/views/payments/payment_request_dialog_view.cc (right): https://codereview.chromium.org/2715213005/diff/60001/chrome/browser/ui/views/payments/payment_request_dialog_view.cc#newcode146 chrome/browser/ui/views/payments/payment_request_dialog_view.cc:146: void PaymentRequestDialogView::UpdatePayButtonState(bool enabled) ...
3 years, 9 months ago
(2017-02-28 19:42:39 UTC)
#9
Have a look at this version?
https://codereview.chromium.org/2715213005/diff/60001/chrome/browser/ui/views...
File chrome/browser/ui/views/payments/payment_request_dialog_view.cc (right):
https://codereview.chromium.org/2715213005/diff/60001/chrome/browser/ui/views...
chrome/browser/ui/views/payments/payment_request_dialog_view.cc:146: void
PaymentRequestDialogView::UpdatePayButtonState(bool enabled) {
On 2017/02/28 17:16:32, anthonyvd wrote:
> I don't think this pattern is the way to go:
>
> 1. The Payment Sheet isn't the only one with a pay button
> 2. Multiple Sheets layered on top of each other might need to update their pay
> button at the same time
> 3. Traversing the view hierarchy isn't expensive but it's also not free.
> 4. As your comment mentions, there are weird states where the dialog is closed
> and PR calls this function
>
> I would instead add an PaymentRequest::Observer that raises a
> PaymentInformationChanged() event. View controllers can query PaymentRequest
in
> their implementation of the observer to determine the state of the pay button
> and subscribe/unsubscribe themselves to avoid lifetime issues.
>
> WDYT?
OMG yes, it's much better with observers. Good catch about the pay button on
multiple screens, too.
Mathieu
Patchset #5 (id:80001) has been deleted
3 years, 9 months ago
(2017-02-28 19:49:31 UTC)
#10
Patchset #5 (id:80001) has been deleted
Mathieu
Patchset #3 (id:40001) has been deleted
3 years, 9 months ago
(2017-02-28 19:49:38 UTC)
#11
Patchset #3 (id:40001) has been deleted
anthonyvd
lgtm % a couple comments. Thanks for the changes! https://codereview.chromium.org/2715213005/diff/120001/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.cc File chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.cc (right): https://codereview.chromium.org/2715213005/diff/120001/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.cc#newcode188 chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.cc:188: ...
3 years, 9 months ago
(2017-02-28 21:07:18 UTC)
#12
Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_compile_dbg/builds/220489)
3 years, 9 months ago
(2017-02-28 22:11:37 UTC)
#18
CQ is committing da patch. Bot data: {"patchset_id": 100002, "attempt_start_ts": 1488324035668540, "parent_rev": "15db143218636b7f14ef38f9e5eb61479daa4b84", "commit_rev": "d4be8de802d4fd6e2b8ec7a85253eae7db69c15e"}
3 years, 9 months ago
(2017-03-01 00:51:52 UTC)
#21
CQ is committing da patch.
Bot data: {"patchset_id": 100002, "attempt_start_ts": 1488324035668540,
"parent_rev": "15db143218636b7f14ef38f9e5eb61479daa4b84", "commit_rev":
"d4be8de802d4fd6e2b8ec7a85253eae7db69c15e"}
commit-bot: I haz the power
Description was changed from ========== [Payments] Add the pay button, and control its enabled state ...
3 years, 9 months ago
(2017-03-01 00:52:54 UTC)
#22
Message was sent while issue was closed.
Description was changed from
==========
[Payments] Add the pay button, and control its enabled state
Depending on the data requested by the merchant, the pay button may or
may not be disabled. More validation and logic to follow.
BUG=696733
TEST=PaymentSheet... interactive_ui_tests
==========
to
==========
[Payments] Add the pay button, and control its enabled state
Depending on the data requested by the merchant, the pay button may or
may not be disabled. More validation and logic to follow.
BUG=696733
TEST=PaymentSheet... interactive_ui_tests
Review-Url: https://codereview.chromium.org/2715213005
Cr-Commit-Position: refs/heads/master@{#453781}
Committed:
https://chromium.googlesource.com/chromium/src/+/d4be8de802d4fd6e2b8ec7a85253...
==========
commit-bot: I haz the power
Committed patchset #6 (id:100002) as https://chromium.googlesource.com/chromium/src/+/d4be8de802d4fd6e2b8ec7a85253eae7db69c15e
3 years, 9 months ago
(2017-03-01 00:52:55 UTC)
#23
Issue 2715213005: [Payments] Add the pay button, and control its enabled state
(Closed)
Created 3 years, 9 months ago by Mathieu
Modified 3 years, 9 months ago
Reviewers: anthonyvd
Base URL:
Comments: 10