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

Unified Diff: media/base/android/java/src/org/chromium/media/ScreenCaptureFactory.java

Issue 1140113002: Implement screen capture for android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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: media/base/android/java/src/org/chromium/media/ScreenCaptureFactory.java
diff --git a/media/base/android/java/src/org/chromium/media/ScreenCaptureFactory.java b/media/base/android/java/src/org/chromium/media/ScreenCaptureFactory.java
new file mode 100644
index 0000000000000000000000000000000000000000..e0b5d161394427c8fe3a5b6c250bed470b6609b4
--- /dev/null
+++ b/media/base/android/java/src/org/chromium/media/ScreenCaptureFactory.java
@@ -0,0 +1,31 @@
+// Copyright 2015 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.media;
+
+import android.content.Context;
+import android.os.Build;
+
+import org.chromium.base.CalledByNative;
+import org.chromium.base.JNINamespace;
+
+@JNINamespace("media")
+@SuppressWarnings("deprecation")
+class ScreenCaptureFactory {
+
+ private static final String TAG = "ScreenCaptureAndroid";
+
+ private static boolean isLReleaseOrLater() {
+ return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
miu 2015/05/20 03:33:27 nit: This expression doesn't need its own method.
+ }
+
+ // Factory methods.
+ @CalledByNative
+ static ScreenCapture createScreenCapture(Context context, long nativeScreenCapturerAndroid) {
+ if (isLReleaseOrLater()) {
+ return new ScreenCapture(context, nativeScreenCapturerAndroid);
+ }
+ return null;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698