Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/mojo/ChromeServiceRegistrar.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/mojo/ChromeServiceRegistrar.java b/chrome/android/java/src/org/chromium/chrome/browser/mojo/ChromeServiceRegistrar.java |
| index 76af5f40e4349c5e4620ba158b595da083b19086..a63344e06439a759d397f01693e71edb51734620 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/mojo/ChromeServiceRegistrar.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/mojo/ChromeServiceRegistrar.java |
| @@ -6,17 +6,36 @@ package org.chromium.chrome.browser.mojo; |
| import org.chromium.base.annotations.CalledByNative; |
| import org.chromium.chrome.browser.payments.PaymentRequestFactory; |
| +import org.chromium.chrome.browser.webshare.ShareServiceImpl; |
| import org.chromium.content.browser.ServiceRegistry; |
| +import org.chromium.content.browser.ServiceRegistry.ImplementationFactory; |
| import org.chromium.content_public.browser.WebContents; |
| import org.chromium.mojom.payments.PaymentRequest; |
| +import org.chromium.mojom.webshare.ShareService; |
| /** |
| * Registers mojo services exposed by Chrome in the given registry. |
| */ |
| class ChromeServiceRegistrar { |
| + 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.
|
| + implements ImplementationFactory<ShareService> { |
| + private final WebContents mWebContents; |
| + |
| + ShareServiceImplementationFactory(WebContents webContents) { |
| + mWebContents = webContents; |
| + } |
| + |
| + @Override |
| + public ShareService createImpl() { |
| + return new ShareServiceImpl(mWebContents); |
| + } |
| + } |
| + |
| @CalledByNative |
| private static void registerRenderFrameMojoServices( |
| ServiceRegistry registry, WebContents webContents) { |
| registry.addService(PaymentRequest.MANAGER, new PaymentRequestFactory(webContents)); |
| + registry.addService( |
| + ShareService.MANAGER, new ShareServiceImplementationFactory(webContents)); |
| } |
| } |