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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/mojo/ChromeServiceRegistrar.java

Issue 1814133002: Added experimental Share API on Android behind flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ballista-share-requester-mojo-blink
Patch Set: Fix comment format. Created 4 years, 5 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.mojo; 5 package org.chromium.chrome.browser.mojo;
6 6
7 import org.chromium.base.annotations.CalledByNative; 7 import org.chromium.base.annotations.CalledByNative;
8 import org.chromium.chrome.browser.payments.PaymentRequestFactory; 8 import org.chromium.chrome.browser.payments.PaymentRequestFactory;
9 import org.chromium.chrome.browser.webshare.ShareServiceImpl;
9 import org.chromium.content.browser.ServiceRegistry; 10 import org.chromium.content.browser.ServiceRegistry;
11 import org.chromium.content.browser.ServiceRegistry.ImplementationFactory;
10 import org.chromium.content_public.browser.WebContents; 12 import org.chromium.content_public.browser.WebContents;
11 import org.chromium.mojom.payments.PaymentRequest; 13 import org.chromium.mojom.payments.PaymentRequest;
14 import org.chromium.mojom.webshare.ShareService;
12 15
13 /** 16 /**
14 * Registers mojo services exposed by Chrome in the given registry. 17 * Registers mojo services exposed by Chrome in the given registry.
15 */ 18 */
16 class ChromeServiceRegistrar { 19 class ChromeServiceRegistrar {
20 private static class ShareServiceImplementationFactory
Sam McNally 2016/07/26 08:21:51 Why is this here?
Matt Giuca 2016/07/28 05:58:32 Follows the pattern here: https://cs.chromium.org/
Sam McNally 2016/07/28 07:16:04 The pattern described by "BatteryMonitorFactory ca
Matt Giuca 2016/07/28 07:40:42 I was looking at the VibrationManagerImplementatio
Matt Giuca 2016/07/28 07:56:09 Done.
21 implements ImplementationFactory<ShareService> {
22 private final WebContents mWebContents;
23
24 ShareServiceImplementationFactory(WebContents webContents) {
25 mWebContents = webContents;
26 }
27
28 @Override
29 public ShareService createImpl() {
30 return new ShareServiceImpl(mWebContents);
31 }
32 }
33
17 @CalledByNative 34 @CalledByNative
18 private static void registerRenderFrameMojoServices( 35 private static void registerRenderFrameMojoServices(
19 ServiceRegistry registry, WebContents webContents) { 36 ServiceRegistry registry, WebContents webContents) {
20 registry.addService(PaymentRequest.MANAGER, new PaymentRequestFactory(we bContents)); 37 registry.addService(PaymentRequest.MANAGER, new PaymentRequestFactory(we bContents));
38 registry.addService(
39 ShareService.MANAGER, new ShareServiceImplementationFactory(webC ontents));
21 } 40 }
22 } 41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698