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

Side by Side Diff: chrome/browser/payments/payment_request_impl.cc

Issue 2446093004: [Web Payments] Initial plumb of Payment Request dialog (Closed)
Patch Set: Replaced my flag with existing one Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
please use gerrit instead 2016/11/04 21:58:12 Ditto
Kevin Bailey 2016/11/09 16:25:20 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/payments/payment_request_impl.h"
6
7 #include "chrome/browser/payments/ui/payment_request_dialog.h"
8 #include "components/web_modal/web_contents_modal_dialog_host.h"
9 #include "components/web_modal/web_contents_modal_dialog_manager.h"
10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h"
11
12 void CreatePaymentRequestHandler(
13 content::RenderFrameHost* render_frame_host,
14 content::WebContents* web_contents,
15 mojo::InterfaceRequest<blink::mojom::PaymentRequest> request) {
16 // TODO: The goal was that this delete itself, but it doesn't yet.
17 new PaymentRequestImpl(render_frame_host, web_contents, std::move(request));
18 }
19
20 PaymentRequestImpl::PaymentRequestImpl(
21 content::RenderFrameHost* unused_render_frame_host,
22 content::WebContents* web_contents,
23 mojo::InterfaceRequest<blink::mojom::PaymentRequest> request)
24 // TODO: consider a weak ptr too
25 : web_contents_(web_contents),
26 binding_(this, std::move(request)) {
27 }
28
29 void PaymentRequestImpl::Init(
30 blink::mojom::PaymentRequestClientPtr client,
31 std::vector<blink::mojom::PaymentMethodDataPtr> methodData,
32 blink::mojom::PaymentDetailsPtr details,
33 blink::mojom::PaymentOptionsPtr options) {
34 // TODO: Give the dialog |this| to delete it when done.
please use gerrit instead 2016/11/04 21:58:13 Did you plan to address these TODOs in this CL?
Kevin Bailey 2016/11/09 16:25:20 No, not yet.
35 views::DialogDelegate::CreateDialogWidget(new PaymentRequestDialog, nullptr,
36 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents_)
37 ->delegate()
38 ->GetWebContentsModalDialogHost()
39 ->GetHostView())->Show();
40 }
41
42 PaymentRequestImpl::~PaymentRequestImpl() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698