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

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

Issue 652673002: NOT FOR REVIEW: Modify ToggleFullscreenMode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fixPowerBlockerNonMedia
Patch Set: Rebase Created 6 years, 2 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: android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java b/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java
index 1746eb0fd520549faf3118a9b0bd330924caf1be..27b77bb1640be4eb8335e286ce31f5a7bfc5fa48 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java
@@ -31,12 +31,14 @@ class AwWebContentsDelegateAdapter extends AwWebContentsDelegate {
private static final String TAG = "AwWebContentsDelegateAdapter";
final AwContentsClient mContentsClient;
+ final AwContentViewClient mContentViewClient;
View mContainerView;
final Context mContext;
public AwWebContentsDelegateAdapter(AwContentsClient contentsClient,
- View containerView, Context context) {
+ AwContentViewClient contentViewClient, View containerView, Context context) {
mContentsClient = contentsClient;
+ mContentViewClient = contentViewClient;
setContainerView(containerView);
mContext = context;
}
@@ -213,11 +215,20 @@ class AwWebContentsDelegateAdapter extends AwWebContentsDelegate {
}
@Override
- public void toggleFullscreenModeForTab(boolean enterFullscreen) {
- if (!enterFullscreen) {
- ContentVideoView videoView = ContentVideoView.getContentVideoView();
- if (videoView != null) videoView.exitFullscreen(false);
+ public void toggleFullscreenModeForTab(boolean enterFullscreen, boolean isVideo) {
+ if (enterFullscreen) {
+ if (!isVideo) {
+ mContentViewClient.enterFullscreen();
+ }
+ } else {
+ if (isVideo) {
+ ContentVideoView videoView = ContentVideoView.getContentVideoView();
+ if (videoView != null) videoView.exitFullscreen(false);
+ } else {
+ mContentViewClient.exitFullscreen();
+ }
}
+
}
private static class GetDisplayNameTask extends AsyncTask<Void, Void, String[]> {

Powered by Google App Engine
This is Rietveld 408576698