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

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: addressed comments 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..13b29ab4f02e6abff3e1589a600b864e32338e3d 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;
@@ -295,9 +297,10 @@ public class Shell extends LinearLayout {
private void initFromNativeTabContents(WebContents webContents) {
Context context = getContext();
mContentViewCore = new ContentViewCore(context, "");
+ mViewRoot = ViewRoot.create(mWindow);
ContentView cv = ContentView.createContentView(context, mContentViewCore);
mContentViewCore.initialize(ViewAndroidDelegate.createBasicDelegate(cv), cv,
- webContents, mWindow);
+ webContents, mWindow, mViewRoot);
mContentViewCore.setActionModeCallback(defaultActionCallback());
mContentViewCore.setContentViewClient(mContentViewClient);
mWebContents = mContentViewCore.getWebContents();
@@ -311,7 +314,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 +367,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