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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ServiceRegistrar.java

Issue 2191033002: Split ServiceRegistryAndroid into InterfaceRegistryAndroid and InterfaceProviderAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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: content/public/android/java/src/org/chromium/content/browser/ServiceRegistrar.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ServiceRegistrar.java b/content/public/android/java/src/org/chromium/content/browser/ServiceRegistrar.java
deleted file mode 100644
index a9d7f8f9d8cd64e7457dd7b6371028a611217c61..0000000000000000000000000000000000000000
--- a/content/public/android/java/src/org/chromium/content/browser/ServiceRegistrar.java
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.content.browser;
-
-import android.content.Context;
-
-import org.chromium.base.annotations.CalledByNative;
-import org.chromium.base.annotations.JNINamespace;
-import org.chromium.content.browser.ServiceRegistry.ImplementationFactory;
-import org.chromium.device.battery.BatteryMonitorFactory;
-import org.chromium.device.vibration.VibrationManagerImpl;
-import org.chromium.mojom.device.BatteryMonitor;
-import org.chromium.mojom.device.VibrationManager;
-
-/**
- * Registers mojo services exposed by the browser in the given registry.
- */
-@JNINamespace("content")
-class ServiceRegistrar {
- // BatteryMonitorFactory can't implement ImplementationFactory itself, as we don't depend on
- // /content in /device. Hence we use BatteryMonitorImplementationFactory as a wrapper.
- private static class BatteryMonitorImplementationFactory
- implements ImplementationFactory<BatteryMonitor> {
- private final BatteryMonitorFactory mFactory;
-
- BatteryMonitorImplementationFactory(Context applicationContext) {
- mFactory = new BatteryMonitorFactory(applicationContext);
- }
-
- @Override
- public BatteryMonitor createImpl() {
- return mFactory.createMonitor();
- }
- }
-
- private static class VibrationManagerImplementationFactory
- implements ImplementationFactory<VibrationManager> {
- private final Context mApplicationContext;
-
- VibrationManagerImplementationFactory(Context applicationContext) {
- mApplicationContext = applicationContext;
- }
-
- @Override
- public VibrationManager createImpl() {
- return new VibrationManagerImpl(mApplicationContext);
- }
- }
-
- @CalledByNative
- static void registerProcessHostServices(ServiceRegistry registry, Context applicationContext) {
- assert applicationContext != null;
- registry.addService(BatteryMonitor.MANAGER,
- new BatteryMonitorImplementationFactory(applicationContext));
- }
-
- @CalledByNative
- static void registerFrameHostServices(ServiceRegistry registry, Context applicationContext) {
- assert applicationContext != null;
- registry.addService(VibrationManager.MANAGER,
- new VibrationManagerImplementationFactory(applicationContext));
- // TODO(avayvod): Register the PresentationService implementation here.
- }
-}

Powered by Google App Engine
This is Rietveld 408576698