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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/shapedetection/BarcodeDetectionImpl.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/BarcodeDetectionImpl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/shapedetection/BarcodeDetectionImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/shapedetection/BarcodeDetectionImpl.java
index 2035620acc09e46e70692baf37bfbe6cbac930e5..6d46e5fa3985d7948e29ab92ed28f90c75b43914 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/shapedetection/BarcodeDetectionImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/shapedetection/BarcodeDetectionImpl.java
@@ -22,6 +22,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.BarcodeDetection;
import org.chromium.shape_detection.mojom.BarcodeDetectionResult;
@@ -123,4 +124,19 @@ public class BarcodeDetectionImpl implements BarcodeDetection {
close();
}
+ /**
+ * A factory class to register BarcodeDetection interface.
+ */
+ public static class Factory implements InterfaceFactory<BarcodeDetection> {
+ private final Context mContext;
+
+ public Factory(Context context) {
+ mContext = context;
+ }
+
+ @Override
+ public BarcodeDetection createImpl() {
+ return new BarcodeDetectionImpl(mContext);
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698