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

Unified 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 side-by-side diff with in-line comments
Download patch
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));
}
}

Powered by Google App Engine
This is Rietveld 408576698