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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.android_webview; 5 package org.chromium.android_webview;
6 6
7 import android.content.ContentResolver; 7 import android.content.ContentResolver;
8 import android.content.Context; 8 import android.content.Context;
9 import android.net.Uri; 9 import android.net.Uri;
10 import android.os.AsyncTask; 10 import android.os.AsyncTask;
(...skipping 13 matching lines...) Expand all
24 24
25 /** 25 /**
26 * Adapts the AwWebContentsDelegate interface to the AwContentsClient interface. 26 * Adapts the AwWebContentsDelegate interface to the AwContentsClient interface.
27 * This class also serves a secondary function of routing certain callbacks from the content layer 27 * This class also serves a secondary function of routing certain callbacks from the content layer
28 * to specific listener interfaces. 28 * to specific listener interfaces.
29 */ 29 */
30 class AwWebContentsDelegateAdapter extends AwWebContentsDelegate { 30 class AwWebContentsDelegateAdapter extends AwWebContentsDelegate {
31 private static final String TAG = "AwWebContentsDelegateAdapter"; 31 private static final String TAG = "AwWebContentsDelegateAdapter";
32 32
33 final AwContentsClient mContentsClient; 33 final AwContentsClient mContentsClient;
34 final AwContentViewClient mContentViewClient;
34 View mContainerView; 35 View mContainerView;
35 final Context mContext; 36 final Context mContext;
36 37
37 public AwWebContentsDelegateAdapter(AwContentsClient contentsClient, 38 public AwWebContentsDelegateAdapter(AwContentsClient contentsClient,
38 View containerView, Context context) { 39 AwContentViewClient contentViewClient, View containerView, Context c ontext) {
39 mContentsClient = contentsClient; 40 mContentsClient = contentsClient;
41 mContentViewClient = contentViewClient;
40 setContainerView(containerView); 42 setContainerView(containerView);
41 mContext = context; 43 mContext = context;
42 } 44 }
43 45
44 public void setContainerView(View containerView) { 46 public void setContainerView(View containerView) {
45 mContainerView = containerView; 47 mContainerView = containerView;
46 } 48 }
47 49
48 @Override 50 @Override
49 public void onLoadProgressChanged(int progress) { 51 public void onLoadProgressChanged(int progress) {
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 public boolean addNewContents(boolean isDialog, boolean isUserGesture) { 208 public boolean addNewContents(boolean isDialog, boolean isUserGesture) {
207 return mContentsClient.onCreateWindow(isDialog, isUserGesture); 209 return mContentsClient.onCreateWindow(isDialog, isUserGesture);
208 } 210 }
209 211
210 @Override 212 @Override
211 public void activateContents() { 213 public void activateContents() {
212 mContentsClient.onRequestFocus(); 214 mContentsClient.onRequestFocus();
213 } 215 }
214 216
215 @Override 217 @Override
216 public void toggleFullscreenModeForTab(boolean enterFullscreen) { 218 public void toggleFullscreenModeForTab(boolean enterFullscreen, boolean isVi deo) {
217 if (!enterFullscreen) { 219 if (enterFullscreen) {
218 ContentVideoView videoView = ContentVideoView.getContentVideoView(); 220 if (!isVideo) {
219 if (videoView != null) videoView.exitFullscreen(false); 221 mContentViewClient.enterFullscreen();
222 }
223 } else {
224 if (isVideo) {
225 ContentVideoView videoView = ContentVideoView.getContentVideoVie w();
226 if (videoView != null) videoView.exitFullscreen(false);
227 } else {
228 mContentViewClient.exitFullscreen();
229 }
220 } 230 }
231
221 } 232 }
222 233
223 private static class GetDisplayNameTask extends AsyncTask<Void, Void, String []> { 234 private static class GetDisplayNameTask extends AsyncTask<Void, Void, String []> {
224 final int mProcessId; 235 final int mProcessId;
225 final int mRenderId; 236 final int mRenderId;
226 final int mModeFlags; 237 final int mModeFlags;
227 final String[] mFilePaths; 238 final String[] mFilePaths;
228 final ContentResolver mContentResolver; 239 final ContentResolver mContentResolver;
229 240
230 public GetDisplayNameTask(ContentResolver contentResolver, int processId , int renderId, 241 public GetDisplayNameTask(ContentResolver contentResolver, int processId , int renderId,
(...skipping 24 matching lines...) Expand all
255 * or an empty string otherwise. 266 * or an empty string otherwise.
256 */ 267 */
257 private String resolveFileName(String filePath) { 268 private String resolveFileName(String filePath) {
258 if (mContentResolver == null || filePath == null) return ""; 269 if (mContentResolver == null || filePath == null) return "";
259 Uri uri = Uri.parse(filePath); 270 Uri uri = Uri.parse(filePath);
260 return ContentUriUtils.getDisplayName( 271 return ContentUriUtils.getDisplayName(
261 uri, mContentResolver, MediaStore.MediaColumns.DISPLAY_NAME) ; 272 uri, mContentResolver, MediaStore.MediaColumns.DISPLAY_NAME) ;
262 } 273 }
263 } 274 }
264 } 275 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698