Description[WebPayments] Move views-specific code to c/b/ui/views/
This CL moves the PaymentRequestDialog class to c/b/ui/views/.
Moving it is required because:
a) It's views-specific, so convention dictates it should live in
c/b/ui/views/
b) It will consume views specific code, which is disallowed from c/b/*
This also means that PaymentRequestImpl can't directly instantiate
PaymentRequestDialog anymore. This is solved by adding the
ShowWebPaymentsDialog function to BrowserWindow.
This CL also fixes some lifetime and ownership issues that became
apparent during the move. Specifically:
a) payments::mojom::PaymentRequestClientPtr should be owned by
PaymentRequestImpl rather than the dialog code. This way, a non-views
implementation of the UI only has to know about PaymentRequestImpl
and the code that interacts with the client doesn't have to be
duplicated.
b) The dialog is now opened through
constrained_window::ShowWebModalDialogViews(), constraining it to the
triggering WebContents and closing it automatically when the tab is
closed.
BUG=667872
Committed: https://crrev.com/3d7f9727782b932937b4e031bc0d88ccceefe1f3
Cr-Commit-Position: refs/heads/master@{#437018}
Patch Set 1 #Patch Set 2 : Fix mac build. #Patch Set 3 : Implement ShowWebPaymentsDialog in TestBrowserWindow #
Total comments: 6
Patch Set 4 : Add comment about PaymentRequestImpl* ownership/lifetime. #
Total comments: 8
Patch Set 5 : Add description to PaymentRequestDialog. #Patch Set 6 : Pipe ShowPaymentRequestDialog through browser_dialogs #Patch Set 7 : Rebase #Messages
Total messages: 35 (18 generated)
|