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

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

Issue 2595263002: Introduce ViewRoot forwarding input/view events to native (Closed)
Patch Set: tests Created 3 years, 12 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: content/shell/android/java/src/org/chromium/content_shell/Shell.java
diff --git a/content/shell/android/java/src/org/chromium/content_shell/Shell.java b/content/shell/android/java/src/org/chromium/content_shell/Shell.java
index e2f82e34584bb68430d33a6a1396760ae116293b..b9ea81bd609cacc4232095d9ee79432c52124963 100644
--- a/content/shell/android/java/src/org/chromium/content_shell/Shell.java
+++ b/content/shell/android/java/src/org/chromium/content_shell/Shell.java
@@ -37,6 +37,7 @@ import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.browser.NavigationController;
import org.chromium.content_public.browser.WebContents;
import org.chromium.ui.base.ViewAndroidDelegate;
+import org.chromium.ui.base.ViewRoot;
import org.chromium.ui.base.WindowAndroid;
/**
@@ -56,6 +57,7 @@ public class Shell extends LinearLayout {
private ContentViewCore mContentViewCore;
private WebContents mWebContents;
+ private ViewRoot mViewRoot;
private NavigationController mNavigationController;
private ContentViewClient mContentViewClient;
private EditText mUrlTextView;
@@ -301,6 +303,8 @@ public class Shell extends LinearLayout {
mContentViewCore.setActionModeCallback(defaultActionCallback());
mContentViewCore.setContentViewClient(mContentViewClient);
mWebContents = mContentViewCore.getWebContents();
+ mViewRoot = ViewRoot.create(mWindow);
+ mWebContents.initViewRoot(mViewRoot);
mNavigationController = mWebContents.getNavigationController();
if (getParent() != null) mContentViewCore.onShow();
if (mWebContents.getUrl() != null) {
@@ -311,7 +315,7 @@ public class Shell extends LinearLayout {
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.MATCH_PARENT));
cv.requestFocus();
- mContentViewRenderView.setCurrentContentViewCore(mContentViewCore);
+ mContentViewRenderView.setCurrentContent(mContentViewCore, mViewRoot);
}
/**
@@ -364,6 +368,13 @@ public class Shell extends LinearLayout {
}
/**
+ * @return {@link ViewRoot} instance used to forward view/input events.
+ */
+ ViewRoot getViewRoot() {
+ return mViewRoot;
+ }
+
+ /**
* Enable/Disable navigation(Prev/Next) button if navigation is allowed/disallowed
* in respective direction.
* @param controlId Id of button to update

Powered by Google App Engine
This is Rietveld 408576698