Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Issue 2529733002: [WebPayments] Move views-specific code to c/b/ui/views/ (Closed)

Created:
4 years ago by anthonyvd
Modified:
4 years ago
CC:
chromium-reviews, tfarina
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+84 lines, -117 lines) Patch
M chrome/browser/BUILD.gn View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
D chrome/browser/payments/BUILD.gn View 1 chunk +0 lines, -16 lines 0 comments Download
M chrome/browser/payments/payment_request_impl.h View 1 2 3 4 5 6 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/payments/payment_request_impl.cc View 1 2 3 4 5 3 chunks +9 lines, -15 lines 0 comments Download
D chrome/browser/payments/ui/payment_request_dialog.h View 1 chunk +0 lines, -38 lines 0 comments Download
D chrome/browser/payments/ui/payment_request_dialog.cc View 1 chunk +0 lines, -39 lines 0 comments Download
M chrome/browser/ui/BUILD.gn View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/browser_dialogs.h View 1 2 3 4 5 6 2 chunks +6 lines, -0 lines 0 comments Download
A chrome/browser/ui/views/payments/payment_request_dialog.h View 1 2 3 4 1 chunk +45 lines, -0 lines 0 comments Download
A + chrome/browser/ui/views/payments/payment_request_dialog.cc View 1 2 3 4 5 2 chunks +15 lines, -5 lines 0 comments Download

Messages

Total messages: 35 (18 generated)
anthonyvd
Hello Rouslan and Kevin, As requested in https://codereview.chromium.org/2528503002, this CL moves all views-specific code to ...
4 years ago (2016-11-23 20:13:45 UTC) #4
please use gerrit instead
LGTM after comment We should avoid raw pointers and be super clear about ownership of ...
4 years ago (2016-11-28 15:16:41 UTC) #15
Kevin Bailey
https://codereview.chromium.org/2529733002/diff/40001/chrome/browser/ui/browser_window.h File chrome/browser/ui/browser_window.h (right): https://codereview.chromium.org/2529733002/diff/40001/chrome/browser/ui/browser_window.h#newcode402 chrome/browser/ui/browser_window.h:402: virtual void ShowWebPaymentsDialog(payments::PaymentRequestImpl* impl) = 0; This addition looks ...
4 years ago (2016-11-28 15:53:52 UTC) #16
anthonyvd
https://codereview.chromium.org/2529733002/diff/40001/chrome/browser/ui/views/payments/payment_request_dialog.h File chrome/browser/ui/views/payments/payment_request_dialog.h (right): https://codereview.chromium.org/2529733002/diff/40001/chrome/browser/ui/views/payments/payment_request_dialog.h#newcode30 chrome/browser/ui/views/payments/payment_request_dialog.h:30: PaymentRequestImpl* impl_; // Not owned. On 2016/11/28 at 15:16:41, ...
4 years ago (2016-11-28 16:12:18 UTC) #17
anthonyvd
https://codereview.chromium.org/2529733002/diff/40001/chrome/browser/ui/browser_window.h File chrome/browser/ui/browser_window.h (right): https://codereview.chromium.org/2529733002/diff/40001/chrome/browser/ui/browser_window.h#newcode402 chrome/browser/ui/browser_window.h:402: virtual void ShowWebPaymentsDialog(payments::PaymentRequestImpl* impl) = 0; On 2016/11/28 at ...
4 years ago (2016-11-28 16:34:01 UTC) #18
Kevin Bailey
https://codereview.chromium.org/2529733002/diff/40001/chrome/browser/ui/browser_window.h File chrome/browser/ui/browser_window.h (right): https://codereview.chromium.org/2529733002/diff/40001/chrome/browser/ui/browser_window.h#newcode402 chrome/browser/ui/browser_window.h:402: virtual void ShowWebPaymentsDialog(payments::PaymentRequestImpl* impl) = 0; Saying 'app' near ...
4 years ago (2016-11-28 17:27:06 UTC) #19
anthonyvd
https://codereview.chromium.org/2529733002/diff/40001/chrome/browser/ui/browser_window.h File chrome/browser/ui/browser_window.h (right): https://codereview.chromium.org/2529733002/diff/40001/chrome/browser/ui/browser_window.h#newcode402 chrome/browser/ui/browser_window.h:402: virtual void ShowWebPaymentsDialog(payments::PaymentRequestImpl* impl) = 0; On 2016/11/28 at ...
4 years ago (2016-11-29 09:08:01 UTC) #20
anthonyvd
So looking into this a bit more, it seems to me like having a function ...
4 years ago (2016-12-05 17:26:24 UTC) #22
sky
https://codereview.chromium.org/2529733002/diff/60001/chrome/browser/payments/payment_request_impl.cc File chrome/browser/payments/payment_request_impl.cc (right): https://codereview.chromium.org/2529733002/diff/60001/chrome/browser/payments/payment_request_impl.cc#newcode59 chrome/browser/payments/payment_request_impl.cc:59: void PaymentRequestImpl::Init( Who is creating this class? Do they ...
4 years ago (2016-12-05 21:49:46 UTC) #23
anthonyvd
https://codereview.chromium.org/2529733002/diff/60001/chrome/browser/payments/payment_request_impl.cc File chrome/browser/payments/payment_request_impl.cc (right): https://codereview.chromium.org/2529733002/diff/60001/chrome/browser/payments/payment_request_impl.cc#newcode59 chrome/browser/payments/payment_request_impl.cc:59: void PaymentRequestImpl::Init( On 2016/12/05 at 21:49:46, sky wrote: > ...
4 years ago (2016-12-05 22:11:27 UTC) #24
sky
https://codereview.chromium.org/2529733002/diff/60001/chrome/browser/ui/views/frame/browser_view.cc File chrome/browser/ui/views/frame/browser_view.cc (right): https://codereview.chromium.org/2529733002/diff/60001/chrome/browser/ui/views/frame/browser_view.cc#newcode2494 chrome/browser/ui/views/frame/browser_view.cc:2494: void BrowserView::ShowWebPaymentsDialog(payments::PaymentRequestImpl* impl) { On 2016/12/05 22:11:27, anthonyvd wrote: ...
4 years ago (2016-12-05 23:23:33 UTC) #25
anthonyvd
Hi everyone, patchset 6 addresses krb@ and sky@'s comments about having ShowPaymentRequestDialog on BrowserWindow by ...
4 years ago (2016-12-06 15:48:26 UTC) #26
sky
LGTM
4 years ago (2016-12-06 17:38:44 UTC) #27
Kevin Bailey
lgtm
4 years ago (2016-12-07 17:06:16 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2529733002/120001
4 years ago (2016-12-07 17:52:38 UTC) #31
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years ago (2016-12-07 18:44:25 UTC) #33
commit-bot: I haz the power
4 years ago (2016-12-07 18:47:00 UTC) #35
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/3d7f9727782b932937b4e031bc0d88ccceefe1f3
Cr-Commit-Position: refs/heads/master@{#437018}

Powered by Google App Engine
This is Rietveld 408576698