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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestFactory.java

Issue 1902913002: Provide web contents to Chrome's mojo services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.payments; 5 package org.chromium.chrome.browser.payments;
6 6
7 import android.content.Context;
8
9 import org.chromium.content.browser.ServiceRegistry.ImplementationFactory; 7 import org.chromium.content.browser.ServiceRegistry.ImplementationFactory;
8 import org.chromium.content_public.browser.WebContents;
10 import org.chromium.mojom.payments.PaymentRequest; 9 import org.chromium.mojom.payments.PaymentRequest;
11 10
12 /** 11 /**
13 * Creates instances of PaymentRequest. 12 * Creates instances of PaymentRequest.
14 */ 13 */
15 public class PaymentRequestFactory implements ImplementationFactory<PaymentReque st> { 14 public class PaymentRequestFactory implements ImplementationFactory<PaymentReque st> {
16 private final Context mApplicationContext; 15 private final WebContents mWebContents;
17 16
18 /** 17 /**
19 * Builds a factory for PaymentRequest. 18 * Builds a factory for PaymentRequest.
20 * 19 *
21 * @param applicationContext The application context. 20 * @param webContents The web contents that may invoke the PaymentRequest AP I.
22 */ 21 */
23 public PaymentRequestFactory(Context applicationContext) { 22 public PaymentRequestFactory(WebContents webContents) {
24 mApplicationContext = applicationContext; 23 mWebContents = webContents;
25 } 24 }
26 25
27 @Override 26 @Override
28 public PaymentRequest createImpl() { 27 public PaymentRequest createImpl() {
29 return new PaymentRequestDialog(mApplicationContext); 28 return new PaymentRequestImpl(mWebContents);
30 } 29 }
31 } 30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698