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

Unified Diff: chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.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: chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java
diff --git a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java
index 1769e37d7d2d11e4e08528366a2ebe40eb6ed1f5..7dbe284fec717aa518d1321f83f7b064bbae91bd 100644
--- a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java
+++ b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java
@@ -4,6 +4,7 @@
package org.chromium.chromecast.shell;
+import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@@ -17,6 +18,8 @@ import android.widget.LinearLayout;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
+import org.chromium.content.browser.ActivityContentVideoViewEmbedder;
+import org.chromium.content.browser.ContentVideoViewEmbedder;
import org.chromium.content.browser.ContentView;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.ContentViewRenderView;
@@ -122,12 +125,15 @@ public class CastWindowAndroid extends LinearLayout {
/**
* Initializes the ContentView based on the native tab contents pointer passed in.
* @param nativeWebContents The pointer to the native tab contents object.
+ * @param renderProcessId ID of the corresponding render process host.
+ * @param productVersion String containing version description.
*/
@SuppressWarnings("unused")
@CalledByNative
- private void initFromNativeWebContents(WebContents webContents, int renderProcessId) {
+ private void initFromNativeWebContents(WebContents webContents, int renderProcessId,
+ String productVersion) {
Context context = getContext();
- mContentViewCore = new ContentViewCore(context);
+ mContentViewCore = new ContentViewCore(context, productVersion);
ContentView view = ContentView.createContentView(context, mContentViewCore);
mContentViewCore.initialize(ViewAndroidDelegate.createBasicDelegate(view), view,
webContents, mWindow);
@@ -156,6 +162,11 @@ public class CastWindowAndroid extends LinearLayout {
};
}
+ @CalledByNative
+ private ContentVideoViewEmbedder getContentVideoViewEmbedder() {
+ return new ActivityContentVideoViewEmbedder((Activity) getContext());
+ }
+
/**
* @return The {@link ViewGroup} currently shown by this Shell.
*/

Powered by Google App Engine
This is Rietveld 408576698