New issue
Advanced search Search tips

Issue 701345 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 3
Type: Bug



Sign in to add a comment

[Payments] Refactor PaymentRequest; make it into parts

Project Member Reported by ma...@chromium.org, Mar 14 2017

Issue description

components/payments/content/payment_request.h is very big and not very unittestable. 

It should be refactored into parts. 

PaymentRequestState will contain everything about the user's state in the flow: what their selections are, and whether they are ready to pay.

PaymentRequestSpec will contain everything about the merchant specification: are they requesting shipping info, payer's info, or what are their supported forms of payments.


 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f1a7a37514b2eda7e895b0e52d120e937d58b385

commit f1a7a37514b2eda7e895b0e52d120e937d58b385
Author: mathp <mathp@chromium.org>
Date: Wed Mar 15 11:23:37 2017

[Payments] Refactor into PaymentRequestState and Spec

The result is more unit-testable.

PaymentRequestState will contain everything about the user's state in
the flow: what their selections are, and whether they are ready to pay.

PaymentRequestSpec will contain everything about the merchant
specification: are they requesting shipping info, payer's info, or what
are their supported forms of payments.

A further CL will attempt to remove the view controller's dependence on
PaymentRequest and rather just pass the state and the spec pointers.

BUG= 701345 
TEST=browser_tests, components_unittests

Review-Url: https://codereview.chromium.org/2742813004
Cr-Commit-Position: refs/heads/master@{#457054}

[modify] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
[modify] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/chrome/browser/ui/views/payments/credit_card_editor_view_controller_browsertest.cc
[modify] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/chrome/browser/ui/views/payments/order_summary_view_controller.cc
[modify] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/chrome/browser/ui/views/payments/order_summary_view_controller.h
[modify] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/chrome/browser/ui/views/payments/payment_method_view_controller.cc
[modify] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc
[modify] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
[modify] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/chrome/browser/ui/views/payments/payment_sheet_view_controller.h
[modify] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/chrome/browser/ui/views/payments/profile_list_view_controller.cc
[modify] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/chrome/browser/ui/views/payments/profile_list_view_controller.h
[modify] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/chrome/browser/ui/views/payments/shipping_option_view_controller.cc
[modify] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/components/payments/content/BUILD.gn
[modify] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/components/payments/content/payment_request.cc
[modify] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/components/payments/content/payment_request.h
[add] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/components/payments/content/payment_request_spec.cc
[add] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/components/payments/content/payment_request_spec.h
[add] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/components/payments/content/payment_request_spec_unittest.cc
[add] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/components/payments/content/payment_request_state.cc
[add] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/components/payments/content/payment_request_state.h
[add] https://crrev.com/f1a7a37514b2eda7e895b0e52d120e937d58b385/components/payments/content/payment_request_state_unittest.cc

Comment 2 by ma...@chromium.org, Mar 15 2017

Status: Fixed (was: Started)
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c0d616afe2d5fb6069007fbbd4899eb257a7f6fc

commit c0d616afe2d5fb6069007fbbd4899eb257a7f6fc
Author: mathp <mathp@chromium.org>
Date: Wed Mar 15 14:09:33 2017

[Payments] Move PersonalDataManager and locale to PaymentRequestState

Also moving the CurrencyFormatter to PaymentRequestSpec

BUG= 701345 
TEST=existing

Review-Url: https://codereview.chromium.org/2741343011
Cr-Commit-Position: refs/heads/master@{#457074}

[modify] https://crrev.com/c0d616afe2d5fb6069007fbbd4899eb257a7f6fc/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
[modify] https://crrev.com/c0d616afe2d5fb6069007fbbd4899eb257a7f6fc/chrome/browser/ui/views/payments/order_summary_view_controller.cc
[modify] https://crrev.com/c0d616afe2d5fb6069007fbbd4899eb257a7f6fc/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
[modify] https://crrev.com/c0d616afe2d5fb6069007fbbd4899eb257a7f6fc/chrome/browser/ui/views/payments/profile_list_view_controller.cc
[modify] https://crrev.com/c0d616afe2d5fb6069007fbbd4899eb257a7f6fc/chrome/browser/ui/views/payments/shipping_option_view_controller.cc
[modify] https://crrev.com/c0d616afe2d5fb6069007fbbd4899eb257a7f6fc/components/payments/content/payment_request.cc
[modify] https://crrev.com/c0d616afe2d5fb6069007fbbd4899eb257a7f6fc/components/payments/content/payment_request.h
[modify] https://crrev.com/c0d616afe2d5fb6069007fbbd4899eb257a7f6fc/components/payments/content/payment_request_spec.cc
[modify] https://crrev.com/c0d616afe2d5fb6069007fbbd4899eb257a7f6fc/components/payments/content/payment_request_spec.h
[modify] https://crrev.com/c0d616afe2d5fb6069007fbbd4899eb257a7f6fc/components/payments/content/payment_request_spec_unittest.cc
[modify] https://crrev.com/c0d616afe2d5fb6069007fbbd4899eb257a7f6fc/components/payments/content/payment_request_state.cc
[modify] https://crrev.com/c0d616afe2d5fb6069007fbbd4899eb257a7f6fc/components/payments/content/payment_request_state.h
[modify] https://crrev.com/c0d616afe2d5fb6069007fbbd4899eb257a7f6fc/components/payments/content/payment_request_state_unittest.cc

Project Member

Comment 4 by bugdroid1@chromium.org, Mar 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a

commit 8be5c3fbeef96d6e423f4e468b6d3c49fe99490a
Author: mathp <mathp@chromium.org>
Date: Wed Mar 15 18:00:08 2017

[Payments] View controllers no longer have access to PaymentRequest

Instead, we pass them PaymentRequestSpec and PaymentRequestState.

BUG= 701345 
TEST=existing

Review-Url: https://codereview.chromium.org/2748133004
Cr-Commit-Position: refs/heads/master@{#457136}

[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/credit_card_editor_view_controller_unittest.cc
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/editor_view_controller.cc
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/editor_view_controller.h
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/order_summary_view_controller.cc
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/order_summary_view_controller.h
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/payment_method_view_controller.cc
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/payment_method_view_controller.h
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/payment_request_dialog_view.cc
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/payment_request_dialog_view.h
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/payment_request_item_list.cc
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/payment_request_item_list.h
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/payment_request_item_list_unittest.cc
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/payment_request_sheet_controller.h
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/payment_sheet_view_controller.h
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/profile_list_view_controller.cc
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/profile_list_view_controller.h
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/shipping_option_view_controller.cc
[modify] https://crrev.com/8be5c3fbeef96d6e423f4e468b6d3c49fe99490a/chrome/browser/ui/views/payments/shipping_option_view_controller.h

Components: -UI>Browser>Autofill>Payments UI>Browser>Payments

Sign in to add a comment