| Index: content/shell/android/java/src/org/chromium/content_shell/ShellManager.java
|
| diff --git a/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java b/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java
|
| index cfddd40862ba0ca82eaaeb47354c160212c5b38a..b3aefbd6575bfd52eb5cbe27f3fbfd73d7d16955 100644
|
| --- a/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java
|
| +++ b/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java
|
| @@ -15,6 +15,7 @@ import org.chromium.base.annotations.JNINamespace;
|
| import org.chromium.content.browser.ContentViewClient;
|
| import org.chromium.content.browser.ContentViewCore;
|
| import org.chromium.content.browser.ContentViewRenderView;
|
| +import org.chromium.ui.base.ViewRoot;
|
| import org.chromium.ui.base.WindowAndroid;
|
|
|
| /**
|
| @@ -25,6 +26,7 @@ public class ShellManager extends FrameLayout {
|
|
|
| public static final String DEFAULT_SHELL_URL = "http://www.google.com";
|
| private WindowAndroid mWindow;
|
| + private ViewRoot mViewRoot;
|
| private Shell mActiveShell;
|
|
|
| private String mStartupUrl = DEFAULT_SHELL_URL;
|
| @@ -42,20 +44,14 @@ public class ShellManager extends FrameLayout {
|
| }
|
|
|
| /**
|
| - * @param window The window used to generate all shells.
|
| + * @param viewRoot viewRoot The {@link ViewROot} used to forward events to native.
|
| */
|
| - public void setWindow(WindowAndroid window) {
|
| - assert window != null;
|
| - mWindow = window;
|
| + public void setViewRoot(ViewRoot viewRoot) {
|
| + assert viewRoot != null;
|
| + mViewRoot = viewRoot;
|
| + mWindow = viewRoot.getWindowAndroid();
|
| mContentViewRenderView = new ContentViewRenderView(getContext());
|
| - mContentViewRenderView.onNativeLibraryLoaded(window);
|
| - }
|
| -
|
| - /**
|
| - * @return The window used to generate all shells.
|
| - */
|
| - public WindowAndroid getWindow() {
|
| - return mWindow;
|
| + mContentViewRenderView.onNativeLibraryLoaded(viewRoot);
|
| }
|
|
|
| /**
|
| @@ -106,7 +102,7 @@ public class ShellManager extends FrameLayout {
|
| LayoutInflater inflater =
|
| (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
| Shell shellView = (Shell) inflater.inflate(R.layout.shell_view, null);
|
| - shellView.initialize(nativeShellPtr, mWindow, mContentViewClient);
|
| + shellView.initialize(nativeShellPtr, mViewRoot, mContentViewClient);
|
|
|
| // TODO(tedchoc): Allow switching back to these inactive shells.
|
| if (mActiveShell != null) removeShell(mActiveShell);
|
|
|