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

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

Issue 2855203003: Shape Detection: move {BarcodeDetectionImpl,TextDetectionImpl}.java to //services/shape_detection (Closed)
Patch Set: Make |java_interface_provider_| a std::unique_ptr<> 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/TextDetectionImpl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/shapedetection/TextDetectionImpl.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/TextDetectionImpl.java
similarity index 93%
rename from chrome/android/java/src/org/chromium/chrome/browser/shapedetection/TextDetectionImpl.java
rename to services/shape_detection/android/java/src/org/chromium/shape_detection/TextDetectionImpl.java
index 2f4fab05161550ec61a1e58f917225984669db9f..d5fd2c5ce8e16bd2b9669e94077297143c473dde 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/shapedetection/TextDetectionImpl.java
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/TextDetectionImpl.java
@@ -2,20 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.chrome.browser.shapedetection;
+package org.chromium.shape_detection;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.util.SparseArray;
+import com.google.android.gms.common.ConnectionResult;
+import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.gms.vision.Frame;
import com.google.android.gms.vision.text.TextBlock;
import com.google.android.gms.vision.text.TextRecognizer;
import org.chromium.base.Log;
-import org.chromium.chrome.browser.externalauth.ExternalAuthUtils;
-import org.chromium.chrome.browser.externalauth.UserRecoverableErrorHandler;
import org.chromium.gfx.mojom.RectF;
import org.chromium.mojo.system.MojoException;
import org.chromium.mojo.system.SharedBufferHandle;
@@ -43,8 +43,8 @@ public class TextDetectionImpl implements TextDetection {
@Override
public void detect(
SharedBufferHandle frameData, int width, int height, DetectResponse callback) {
- if (!ExternalAuthUtils.getInstance().canUseGooglePlayServices(
- mContext, new UserRecoverableErrorHandler.Silent())) {
+ if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(mContext)
+ != ConnectionResult.SUCCESS) {
Log.e(TAG, "Google Play Services not available");
callback.call(new TextDetectionResult[0]);
return;

Powered by Google App Engine
This is Rietveld 408576698