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

Unified Diff: android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java

Issue 223253005: Fix a problem that video does not show up in AW Shell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java
diff --git a/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java b/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java
index b2f79e3617a5cbb578a3fdf8d2bd0eeb158396c1..4f10e7939d1ec806ab37c79fd1e7891c43e1b0ec 100644
--- a/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java
+++ b/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java
@@ -10,14 +10,19 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.TextUtils;
+import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnFocusChangeListener;
+import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
+import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
+import android.webkit.WebChromeClient;
import android.widget.EditText;
+import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -76,12 +81,36 @@ public class AwShellActivity extends Activity {
AwBrowserProcess.start(this);
AwTestContainerView testContainerView = new AwTestContainerView(this);
AwContentsClient awContentsClient = new NullContentsClient() {
+ private View mCustomView;
+
@Override
public void onPageStarted(String url) {
if (mUrlTextView != null) {
mUrlTextView.setText(url);
}
}
+
+ @Override
+ public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) {
+ getWindow().setFlags(
+ WindowManager.LayoutParams.FLAG_FULLSCREEN,
+ WindowManager.LayoutParams.FLAG_FULLSCREEN);
+
+ getWindow().addContentView(view,
+ new FrameLayout.LayoutParams(
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ Gravity.CENTER));
+ mCustomView = view;
+ }
+
+ @Override
+ public void onHideCustomView() {
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ FrameLayout decorView = (FrameLayout) getWindow().getDecorView();
+ decorView.removeView(mCustomView);
+ mCustomView = null;
+ }
};
SharedPreferences sharedPreferences =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698