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

Unified Diff: services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java

Issue 2847523002: Android: Remove GetApplicationContext part 4 (Closed)
Patch Set: Rebase and fix build Created 3 years, 7 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: services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java
index 6938cf30910408ce020286a4f06d01dd172c0cc0..5bb934cb8d0b4b885be10539d7ae0268ac0f26ec 100644
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java
@@ -4,8 +4,7 @@
package org.chromium.shape_detection;
-import android.content.Context;
-
+import org.chromium.base.ContextUtils;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.mojo.system.impl.CoreImpl;
@@ -17,16 +16,17 @@ import org.chromium.shape_detection.mojom.TextDetection;
@JNINamespace("shape_detection")
class InterfaceRegistrar {
@CalledByNative
- static void createInterfaceRegistryForContext(int nativeHandle, Context applicationContext) {
+ static void createInterfaceRegistryForContext(int nativeHandle) {
// Note: The bindings code manages the lifetime of this object, so it
// is not necessary to hold on to a reference to it explicitly.
+ // TODO(wnwen): Move references to getApplicationContext lower.
InterfaceRegistry registry = InterfaceRegistry.create(
CoreImpl.getInstance().acquireNativeHandle(nativeHandle).toMessagePipeHandle());
- registry.addInterface(
- BarcodeDetection.MANAGER, new BarcodeDetectionImpl.Factory(applicationContext));
+ registry.addInterface(BarcodeDetection.MANAGER,
+ new BarcodeDetectionImpl.Factory(ContextUtils.getApplicationContext()));
registry.addInterface(FaceDetectionProvider.MANAGER,
- new FaceDetectionProviderImpl.Factory(applicationContext));
- registry.addInterface(
- TextDetection.MANAGER, new TextDetectionImpl.Factory(applicationContext));
+ new FaceDetectionProviderImpl.Factory(ContextUtils.getApplicationContext()));
+ registry.addInterface(TextDetection.MANAGER,
+ new TextDetectionImpl.Factory(ContextUtils.getApplicationContext()));
}
}
« no previous file with comments | « services/device/time_zone_monitor/time_zone_monitor_android.cc ('k') | services/shape_detection/shape_detection_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698