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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java

Issue 2353063005: Refactor ContentViewClient (1/6) (Closed)
Patch Set: cast to activity Created 4 years, 3 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: chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
index 401988d9e85da6184c53eb0ad2ccb229fa297248..68a4bb306b176bc1746ca4c3aca01a4c5056f6a5 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
@@ -90,9 +90,7 @@ import org.chromium.chrome.browser.util.ColorUtils;
import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils;
import org.chromium.components.navigation_interception.InterceptNavigationDelegate;
import org.chromium.components.security_state.ConnectionSecurityLevel;
-import org.chromium.content.browser.ActivityContentVideoViewEmbedder;
import org.chromium.content.browser.ChildProcessLauncher;
-import org.chromium.content.browser.ContentVideoViewEmbedder;
import org.chromium.content.browser.ContentView;
import org.chromium.content.browser.ContentViewClient;
import org.chromium.content.browser.ContentViewCore;
@@ -156,6 +154,8 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
/** Used for logging. */
private static final String TAG = "Tab";
+ private static final String PRODUCT_VERSION = ChromeVersionInfo.getProductVersion();
+
private long mNativeTabAndroid;
/** Unique id of this tab (within its container). */
@@ -485,42 +485,6 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
}
return 0;
}
-
- @Override
- public ContentVideoViewEmbedder getContentVideoViewEmbedder() {
- return new ActivityContentVideoViewEmbedder(getActivity()) {
- @Override
- public void enterFullscreenVideo(View view, boolean isVideoLoaded) {
- super.enterFullscreenVideo(view, isVideoLoaded);
- FullscreenManager fullscreenManager = getFullscreenManager();
- if (fullscreenManager != null) {
- fullscreenManager.setOverlayVideoMode(true);
- // Disable double tap for video.
- if (getContentViewCore() != null) {
- getContentViewCore().updateDoubleTapSupport(false);
- }
- }
- }
-
- @Override
- public void exitFullscreenVideo() {
- FullscreenManager fullscreenManager = getFullscreenManager();
- if (fullscreenManager != null) {
- fullscreenManager.setOverlayVideoMode(false);
- // Disable double tap for video.
- if (getContentViewCore() != null) {
- getContentViewCore().updateDoubleTapSupport(true);
- }
- }
- super.exitFullscreenVideo();
- }
- };
- }
-
- @Override
- public String getProductVersion() {
- return ChromeVersionInfo.getProductVersion();
- }
}
private GestureStateListener createGestureStateListener() {
@@ -1855,7 +1819,7 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
* {@link ContentViewCore}.
*/
protected void initContentViewCore(WebContents webContents) {
- ContentViewCore cvc = new ContentViewCore(mThemedApplicationContext);
+ ContentViewCore cvc = new ContentViewCore(mThemedApplicationContext, PRODUCT_VERSION);
ContentView cv = ContentView.createContentView(mThemedApplicationContext, cvc);
cv.setContentDescription(mThemedApplicationContext.getResources().getString(
R.string.accessibility_content_view));
@@ -2535,7 +2499,7 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
@CalledByNative
public void swapWebContents(
WebContents webContents, boolean didStartLoad, boolean didFinishLoad) {
- ContentViewCore cvc = new ContentViewCore(mThemedApplicationContext);
+ ContentViewCore cvc = new ContentViewCore(mThemedApplicationContext, PRODUCT_VERSION);
ContentView cv = ContentView.createContentView(mThemedApplicationContext, cvc);
cv.setContentDescription(mThemedApplicationContext.getResources().getString(
R.string.accessibility_content_view));

Powered by Google App Engine
This is Rietveld 408576698