[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
Review-Url: https://codereview.chromium.org/2529733002
Cr-Commit-Position: refs/heads/master@{#437018}
9 files changed