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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/shapedetection/TextDetectionImpl.java

Issue 2650583004: ShapeDetection: Move factory method to static nested class (Closed)
Patch Set: Created 3 years, 11 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/shapedetection/TextDetectionImpl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/shapedetection/TextDetectionImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/shapedetection/TextDetectionImpl.java
index b6f541c20a974b2b71230a9ed8905ddfc0f98b7a..2f4fab05161550ec61a1e58f917225984669db9f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/shapedetection/TextDetectionImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/shapedetection/TextDetectionImpl.java
@@ -20,6 +20,7 @@ import org.chromium.gfx.mojom.RectF;
import org.chromium.mojo.system.MojoException;
import org.chromium.mojo.system.SharedBufferHandle;
import org.chromium.mojo.system.SharedBufferHandle.MapFlags;
+import org.chromium.services.service_manager.InterfaceFactory;
import org.chromium.shape_detection.mojom.TextDetection;
import org.chromium.shape_detection.mojom.TextDetectionResult;
@@ -112,4 +113,20 @@ public class TextDetectionImpl implements TextDetection {
public void onConnectionError(MojoException e) {
close();
}
+
+ /**
+ * A factory class to register TextDetection interface.
+ */
+ public static class Factory implements InterfaceFactory<TextDetection> {
+ private final Context mContext;
+
+ public Factory(Context context) {
+ mContext = context;
+ }
+
+ @Override
+ public TextDetection createImpl() {
+ return new TextDetectionImpl(mContext);
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698