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

Side by Side Diff: content/shell/android/java/src/org/chromium/content_shell/Shell.java

Issue 833363002: Exit fullscreen video for ChromeShell and ContentShell on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTab.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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.content_shell; 5 package org.chromium.content_shell;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.graphics.drawable.ClipDrawable; 8 import android.graphics.drawable.ClipDrawable;
9 import android.text.TextUtils; 9 import android.text.TextUtils;
10 import android.util.AttributeSet; 10 import android.util.AttributeSet;
11 import android.view.KeyEvent; 11 import android.view.KeyEvent;
12 import android.view.View; 12 import android.view.View;
13 import android.view.ViewGroup; 13 import android.view.ViewGroup;
14 import android.view.inputmethod.EditorInfo; 14 import android.view.inputmethod.EditorInfo;
15 import android.view.inputmethod.InputMethodManager; 15 import android.view.inputmethod.InputMethodManager;
16 import android.widget.EditText; 16 import android.widget.EditText;
17 import android.widget.FrameLayout; 17 import android.widget.FrameLayout;
18 import android.widget.ImageButton; 18 import android.widget.ImageButton;
19 import android.widget.LinearLayout; 19 import android.widget.LinearLayout;
20 import android.widget.TextView; 20 import android.widget.TextView;
21 import android.widget.TextView.OnEditorActionListener; 21 import android.widget.TextView.OnEditorActionListener;
22 22
23 import org.chromium.base.CalledByNative; 23 import org.chromium.base.CalledByNative;
24 import org.chromium.base.JNINamespace; 24 import org.chromium.base.JNINamespace;
25 import org.chromium.content.browser.ContentVideoView;
25 import org.chromium.content.browser.ContentView; 26 import org.chromium.content.browser.ContentView;
26 import org.chromium.content.browser.ContentViewClient; 27 import org.chromium.content.browser.ContentViewClient;
27 import org.chromium.content.browser.ContentViewCore; 28 import org.chromium.content.browser.ContentViewCore;
28 import org.chromium.content.browser.ContentViewRenderView; 29 import org.chromium.content.browser.ContentViewRenderView;
29 import org.chromium.content_public.browser.LoadUrlParams; 30 import org.chromium.content_public.browser.LoadUrlParams;
30 import org.chromium.content_public.browser.NavigationController; 31 import org.chromium.content_public.browser.NavigationController;
31 import org.chromium.content_public.browser.WebContents; 32 import org.chromium.content_public.browser.WebContents;
32 import org.chromium.ui.base.WindowAndroid; 33 import org.chromium.ui.base.WindowAndroid;
33 34
34 /** 35 /**
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 removeCallbacks(mClearProgressRunnable); 253 removeCallbacks(mClearProgressRunnable);
253 mProgressDrawable.setLevel((int) (10000.0 * progress)); 254 mProgressDrawable.setLevel((int) (10000.0 * progress));
254 if (progress == 1.0) postDelayed(mClearProgressRunnable, COMPLETED_PROGR ESS_TIMEOUT_MS); 255 if (progress == 1.0) postDelayed(mClearProgressRunnable, COMPLETED_PROGR ESS_TIMEOUT_MS);
255 } 256 }
256 257
257 @CalledByNative 258 @CalledByNative
258 private void toggleFullscreenModeForTab(boolean enterFullscreen) { 259 private void toggleFullscreenModeForTab(boolean enterFullscreen) {
259 mIsFullscreen = enterFullscreen; 260 mIsFullscreen = enterFullscreen;
260 LinearLayout toolBar = (LinearLayout) findViewById(R.id.toolbar); 261 LinearLayout toolBar = (LinearLayout) findViewById(R.id.toolbar);
261 toolBar.setVisibility(enterFullscreen ? GONE : VISIBLE); 262 toolBar.setVisibility(enterFullscreen ? GONE : VISIBLE);
263
264 if (!mIsFullscreen) {
265 ContentVideoView videoView = ContentVideoView.getContentVideoView();
266 if (videoView != null) videoView.exitFullscreen(false);
267 }
262 } 268 }
263 269
264 @CalledByNative 270 @CalledByNative
265 private boolean isFullscreenForTabOrPending() { 271 private boolean isFullscreenForTabOrPending() {
266 return mIsFullscreen; 272 return mIsFullscreen;
267 } 273 }
268 274
269 @SuppressWarnings("unused") 275 @SuppressWarnings("unused")
270 @CalledByNative 276 @CalledByNative
271 private void setIsLoading(boolean loading) { 277 private void setIsLoading(boolean loading) {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 Context.INPUT_METHOD_SERVICE); 348 Context.INPUT_METHOD_SERVICE);
343 if (visible) { 349 if (visible) {
344 imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT); 350 imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT);
345 } else { 351 } else {
346 imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0); 352 imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0);
347 } 353 }
348 } 354 }
349 355
350 private static native void nativeCloseShell(long shellPtr); 356 private static native void nativeCloseShell(long shellPtr);
351 } 357 }
OLDNEW
« no previous file with comments | « chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTab.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698