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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContentVideoViewDelegate.java

Issue 11280284: onShowCustomView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix NullContentsClient compilation error #2 Created 7 years, 10 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
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwContents.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/java/src/org/chromium/android_webview/AwContentVideoViewDelegate.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentVideoViewDelegate.java b/android_webview/java/src/org/chromium/android_webview/AwContentVideoViewDelegate.java
new file mode 100644
index 0000000000000000000000000000000000000000..dfa1e23eda604c519374bffc6dccdef63409b01d
--- /dev/null
+++ b/android_webview/java/src/org/chromium/android_webview/AwContentVideoViewDelegate.java
@@ -0,0 +1,70 @@
+// Copyright (c) 2012 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.android_webview;
+
+import android.content.Context;
+import android.content.pm.ActivityInfo;
+import android.view.View;
+import android.webkit.WebChromeClient.CustomViewCallback;
+
+import org.chromium.content.browser.ContentVideoViewContextDelegate;
+
+/**
+ * This further delegates the responsibility displaying full-screen video to the
+ * Webview client.
+ */
+public class AwContentVideoViewDelegate implements ContentVideoViewContextDelegate {
+ private AwContentsClient mAwContentsClient;
+ private Context mContext;
+
+ public AwContentVideoViewDelegate(AwContentsClient client, Context context) {
+ mAwContentsClient = client;
+ mContext = context;
+ }
+
+ public void onShowCustomView(View view) {
+ CustomViewCallback cb = new CustomViewCallback() {
+ @Override
+ public void onCustomViewHidden() {
+ // TODO: we need to invoke ContentVideoView.onDestroyContentVideoView() here.
+ }
+ };
+ mAwContentsClient.onShowCustomView(view,
+ ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED,
+ cb);
+ }
+
+ public void onDestroyContentVideoView() {
+ }
+
+ public Context getContext() {
+ return mContext;
+ }
+
+ public String getPlayBackErrorText() {
+ return mContext.getString(
+ org.chromium.content.R.string.media_player_error_text_invalid_progressive_playback);
+ }
+
+ public String getUnknownErrorText() {
+ return mContext.getString(
+ org.chromium.content.R.string.media_player_error_text_unknown);
+ }
+
+ public String getErrorButton() {
+ return mContext.getString(
+ org.chromium.content.R.string.media_player_error_button);
+ }
+
+ public String getErrorTitle() {
+ return mContext.getString(
+ org.chromium.content.R.string.media_player_error_title);
+ }
+
+ public String getVideoLoadingText() {
+ return mContext.getString(
+ org.chromium.content.R.string.media_player_loading_video);
+ }
+}
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwContents.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698