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

Side by Side Diff: content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java

Issue 2688193002: Mojo framework for AndroidOverlay. (Closed)
Patch Set: fixed unittest Created 3 years, 10 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.content.browser; 5 package org.chromium.content.browser;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 8
9 import org.chromium.base.annotations.CalledByNative; 9 import org.chromium.base.annotations.CalledByNative;
10 import org.chromium.base.annotations.JNINamespace; 10 import org.chromium.base.annotations.JNINamespace;
11 import org.chromium.content.browser.androidoverlay.AndroidOverlayProviderImpl;
11 import org.chromium.content.browser.shapedetection.FaceDetectionProviderImpl; 12 import org.chromium.content.browser.shapedetection.FaceDetectionProviderImpl;
12 import org.chromium.content_public.browser.InterfaceRegistrar; 13 import org.chromium.content_public.browser.InterfaceRegistrar;
13 import org.chromium.content_public.browser.WebContents; 14 import org.chromium.content_public.browser.WebContents;
14 import org.chromium.device.BatteryMonitor; 15 import org.chromium.device.BatteryMonitor;
15 import org.chromium.device.battery.BatteryMonitorFactory; 16 import org.chromium.device.battery.BatteryMonitorFactory;
16 import org.chromium.device.mojom.VibrationManager; 17 import org.chromium.device.mojom.VibrationManager;
17 import org.chromium.device.nfc.mojom.Nfc; 18 import org.chromium.device.nfc.mojom.Nfc;
18 import org.chromium.device.vibration.VibrationManagerImpl; 19 import org.chromium.device.vibration.VibrationManagerImpl;
20 import org.chromium.media.mojom.AndroidOverlayProvider;
19 import org.chromium.mojo.system.impl.CoreImpl; 21 import org.chromium.mojo.system.impl.CoreImpl;
20 import org.chromium.services.service_manager.InterfaceRegistry; 22 import org.chromium.services.service_manager.InterfaceRegistry;
21 import org.chromium.shape_detection.mojom.FaceDetectionProvider; 23 import org.chromium.shape_detection.mojom.FaceDetectionProvider;
22 24
23 @JNINamespace("content") 25 @JNINamespace("content")
24 class InterfaceRegistrarImpl { 26 class InterfaceRegistrarImpl {
25 27
26 private static boolean sHasRegisteredRegistrars; 28 private static boolean sHasRegisteredRegistrars;
27 29
28 @CalledByNative 30 @CalledByNative
(...skipping 25 matching lines...) Expand all
54 private static class ContentContextInterfaceRegistrar implements InterfaceRe gistrar<Context> { 56 private static class ContentContextInterfaceRegistrar implements InterfaceRe gistrar<Context> {
55 @Override 57 @Override
56 public void registerInterfaces( 58 public void registerInterfaces(
57 InterfaceRegistry registry, final Context applicationContext) { 59 InterfaceRegistry registry, final Context applicationContext) {
58 registry.addInterface( 60 registry.addInterface(
59 VibrationManager.MANAGER, new VibrationManagerImpl.Factory(a pplicationContext)); 61 VibrationManager.MANAGER, new VibrationManagerImpl.Factory(a pplicationContext));
60 registry.addInterface( 62 registry.addInterface(
61 BatteryMonitor.MANAGER, new BatteryMonitorFactory(applicatio nContext)); 63 BatteryMonitor.MANAGER, new BatteryMonitorFactory(applicatio nContext));
62 registry.addInterface(FaceDetectionProvider.MANAGER, 64 registry.addInterface(FaceDetectionProvider.MANAGER,
63 new FaceDetectionProviderImpl.Factory(applicationContext)); 65 new FaceDetectionProviderImpl.Factory(applicationContext));
66 registry.addInterface(AndroidOverlayProvider.MANAGER,
boliu 2017/02/17 21:20:51 this makes Overlay accessible to renderer as well,
liberato (no reviews please) 2017/02/22 16:25:01 as far as i can tell, it does not make it availabl
67 new AndroidOverlayProviderImpl.Factory(applicationContext));
64 // TODO(avayvod): Register the PresentationService implementation he re. 68 // TODO(avayvod): Register the PresentationService implementation he re.
65 } 69 }
66 } 70 }
67 71
68 private static class ContentWebContentsInterfaceRegistrar 72 private static class ContentWebContentsInterfaceRegistrar
69 implements InterfaceRegistrar<WebContents> { 73 implements InterfaceRegistrar<WebContents> {
70 @Override 74 @Override
71 public void registerInterfaces(InterfaceRegistry registry, final WebCont ents webContents) { 75 public void registerInterfaces(InterfaceRegistry registry, final WebCont ents webContents) {
72 registry.addInterface(Nfc.MANAGER, new NfcFactory(webContents)); 76 registry.addInterface(Nfc.MANAGER, new NfcFactory(webContents));
73 } 77 }
74 } 78 }
75 } 79 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698