Also, I see mentions of "unit_tests, browsertests" but no files are present. Would be great ...
3 years, 9 months ago
(2017-03-21 14:05:47 UTC)
#5
Also, I see mentions of "unit_tests, browsertests" but no files are present.
Would be great to have those kinds of tests :)
anthonyvd
Feedback addressed, thanks! Re: tests. The list code is already tested, hence the mention. The ...
3 years, 9 months ago
(2017-03-21 14:56:07 UTC)
#6
Feedback addressed, thanks!
Re: tests. The list code is already tested, hence the mention. The only thing
this CL adds is that the dialog navigates back, which I didn't feel was super
relevant to test. Basically since this is a refactor, existing tests should not
stop passing. Let me know if your opinion differs :)
https://codereview.chromium.org/2759253002/diff/20001/chrome/browser/ui/views...
File chrome/browser/ui/views/payments/payment_request_item_list.cc (right):
https://codereview.chromium.org/2759253002/diff/20001/chrome/browser/ui/views...
chrome/browser/ui/views/payments/payment_request_item_list.cc:117:
list()->SelectItem(this, /*go_back=*/true);
On 2017/03/21 at 13:56:59, Mathieu Perreault wrote:
> Do you think we could do
>
> if (CanBeSelected()) {
> list()->SelectItem(this);
> }
> PerformSelectionConfirmed(/*item_was_selected=*/CanBeSelected());
>
> Each subclass would know what to do in case of item selection. I prefer each
subclass having to decide whether to call dialog_->GoBack().
>
> Let me know what you think.
I changed the code to call GoBack in subclasses implementation of
SelectedStateChanged(). This seemed a bit cleaner than adding another function
that would only call GoBack, yet as flexible.
https://codereview.chromium.org/2759253002/diff/20001/chrome/browser/ui/views...
File chrome/browser/ui/views/payments/payment_sheet_view_controller.cc (right):
https://codereview.chromium.org/2759253002/diff/20001/chrome/browser/ui/views...
chrome/browser/ui/views/payments/payment_sheet_view_controller.cc:209:
std::unique_ptr<views::View> content_view = base::MakeUnique<views::View>();
On 2017/03/21 at 13:56:59, Mathieu Perreault wrote:
> As discussed, let's own the content view instead of an additional
container_view.
Yep will refactor in a follow up, as discussed.
https://codereview.chromium.org/2759253002/diff/20001/chrome/browser/ui/views...
File chrome/browser/ui/views/payments/shipping_option_view_controller.cc
(right):
https://codereview.chromium.org/2759253002/diff/20001/chrome/browser/ui/views...
chrome/browser/ui/views/payments/shipping_option_view_controller.cc:34: void
SelectedStateChanged() override {
On 2017/03/21 at 13:56:59, Mathieu Perreault wrote:
> We always seem to use SelectedStateChanged + selected() - unless I'm wrong. If
this is true perhaps the call should be "item is now selected"?
Yeah I thought about this too. I think it just happens that *now* we only do
stuff when the item is selected but conceptually it makes sense to notify items
when they're deselected as well (for example, some items might want to modify
how they look depending on whether they're selected or not).
Mathieu
On 2017/03/21 14:56:07, anthonyvd wrote: > Feedback addressed, thanks! > > Re: tests. The list ...
3 years, 9 months ago
(2017-03-21 15:07:15 UTC)
#7
On 2017/03/21 14:56:07, anthonyvd wrote:
> Feedback addressed, thanks!
>
> Re: tests. The list code is already tested, hence the mention. The only thing
> this CL adds is that the dialog navigates back, which I didn't feel was super
> relevant to test. Basically since this is a refactor, existing tests should
not
> stop passing. Let me know if your opinion differs :)
>
>
https://codereview.chromium.org/2759253002/diff/20001/chrome/browser/ui/views...
> File chrome/browser/ui/views/payments/payment_request_item_list.cc (right):
>
>
https://codereview.chromium.org/2759253002/diff/20001/chrome/browser/ui/views...
> chrome/browser/ui/views/payments/payment_request_item_list.cc:117:
> list()->SelectItem(this, /*go_back=*/true);
> On 2017/03/21 at 13:56:59, Mathieu Perreault wrote:
> > Do you think we could do
> >
> > if (CanBeSelected()) {
> > list()->SelectItem(this);
> > }
> > PerformSelectionConfirmed(/*item_was_selected=*/CanBeSelected());
> >
> > Each subclass would know what to do in case of item selection. I prefer each
> subclass having to decide whether to call dialog_->GoBack().
> >
> > Let me know what you think.
>
> I changed the code to call GoBack in subclasses implementation of
> SelectedStateChanged(). This seemed a bit cleaner than adding another function
> that would only call GoBack, yet as flexible.
>
>
https://codereview.chromium.org/2759253002/diff/20001/chrome/browser/ui/views...
> File chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
(right):
>
>
https://codereview.chromium.org/2759253002/diff/20001/chrome/browser/ui/views...
> chrome/browser/ui/views/payments/payment_sheet_view_controller.cc:209:
> std::unique_ptr<views::View> content_view = base::MakeUnique<views::View>();
> On 2017/03/21 at 13:56:59, Mathieu Perreault wrote:
> > As discussed, let's own the content view instead of an additional
> container_view.
>
> Yep will refactor in a follow up, as discussed.
>
>
https://codereview.chromium.org/2759253002/diff/20001/chrome/browser/ui/views...
> File chrome/browser/ui/views/payments/shipping_option_view_controller.cc
> (right):
>
>
https://codereview.chromium.org/2759253002/diff/20001/chrome/browser/ui/views...
> chrome/browser/ui/views/payments/shipping_option_view_controller.cc:34: void
> SelectedStateChanged() override {
> On 2017/03/21 at 13:56:59, Mathieu Perreault wrote:
> > We always seem to use SelectedStateChanged + selected() - unless I'm wrong.
If
> this is true perhaps the call should be "item is now selected"?
>
> Yeah I thought about this too. I think it just happens that *now* we only do
> stuff when the item is selected but conceptually it makes sense to notify
items
> when they're deselected as well (for example, some items might want to modify
> how they look depending on whether they're selected or not).
In the browsertests, you can add an event observer for BACK_NAVIGATION, should
be pretty straightforward!
Examples:
https://cs.chromium.org/search/?q=BACK_NAVIGATION+file:payments&sq=package:ch...
anthonyvd
Relevant browser test updated. PTAL!
3 years, 9 months ago
(2017-03-21 19:04:12 UTC)
#8
Relevant browser test updated. PTAL!
Mathieu
lgtm with a UX question https://codereview.chromium.org/2759253002/diff/60001/chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc File chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc (right): https://codereview.chromium.org/2759253002/diff/60001/chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc#newcode105 chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc:105: ClickOnDialogViewAndWait(list_view->child_at(1)); Do we not ...
3 years, 9 months ago
(2017-03-21 19:27:36 UTC)
#9
CQ is committing da patch. Bot data: {"patchset_id": 60001, "attempt_start_ts": 1490128157438190, "parent_rev": "cb791d2124ed2ea2a88e3bdbef1c5cb66dd3e86a", "commit_rev": "0116ce334c021757db311c867d96bb56faeda1b7"}
3 years, 9 months ago
(2017-03-21 21:29:05 UTC)
#13
CQ is committing da patch.
Bot data: {"patchset_id": 60001, "attempt_start_ts": 1490128157438190,
"parent_rev": "cb791d2124ed2ea2a88e3bdbef1c5cb66dd3e86a", "commit_rev":
"0116ce334c021757db311c867d96bb56faeda1b7"}
commit-bot: I haz the power
Description was changed from ========== [Web Payments] Implement item selection in lists. This change implements ...
3 years, 9 months ago
(2017-03-21 21:29:54 UTC)
#14
Message was sent while issue was closed.
Description was changed from
==========
[Web Payments] Implement item selection in lists.
This change implements item selection in all lists in PaymentRequest
dialog sheets. It also implements updating the Payment Sheet after a
selection changes.
BUG=703302
TEST=unit_tests,browsertests
==========
to
==========
[Web Payments] Implement item selection in lists.
This change implements item selection in all lists in PaymentRequest
dialog sheets. It also implements updating the Payment Sheet after a
selection changes.
BUG=703302
TEST=unit_tests,browsertests
Review-Url: https://codereview.chromium.org/2759253002
Cr-Commit-Position: refs/heads/master@{#458553}
Committed:
https://chromium.googlesource.com/chromium/src/+/0116ce334c021757db311c867d96...
==========
commit-bot: I haz the power
Committed patchset #3 (id:60001) as https://chromium.googlesource.com/chromium/src/+/0116ce334c021757db311c867d96bb56faeda1b7
3 years, 9 months ago
(2017-03-21 21:29:55 UTC)
#15
Issue 2759253002: [Web Payments] Implement item selection in lists.
(Closed)
Created 3 years, 9 months ago by anthonyvd
Modified 3 years, 9 months ago
Reviewers: Mathieu
Base URL:
Comments: 8