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

Side by Side Diff: content/shell/android/java/src/org/chromium/content_shell/ShellManager.java

Issue 2595263002: Introduce ViewRoot forwarding input/view events to native (Closed)
Patch Set: tests Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.content_shell; 5 package org.chromium.content_shell;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.util.AttributeSet; 8 import android.util.AttributeSet;
9 import android.view.LayoutInflater; 9 import android.view.LayoutInflater;
10 import android.widget.FrameLayout; 10 import android.widget.FrameLayout;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 return shellView; 115 return shellView;
116 } 116 }
117 117
118 private void showShell(Shell shellView) { 118 private void showShell(Shell shellView) {
119 shellView.setContentViewRenderView(mContentViewRenderView); 119 shellView.setContentViewRenderView(mContentViewRenderView);
120 addView(shellView, new FrameLayout.LayoutParams( 120 addView(shellView, new FrameLayout.LayoutParams(
121 FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams. MATCH_PARENT)); 121 FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams. MATCH_PARENT));
122 mActiveShell = shellView; 122 mActiveShell = shellView;
123 ContentViewCore contentViewCore = mActiveShell.getContentViewCore(); 123 ContentViewCore contentViewCore = mActiveShell.getContentViewCore();
124 if (contentViewCore != null) { 124 if (contentViewCore != null) {
125 mContentViewRenderView.setCurrentContentViewCore(contentViewCore); 125 mContentViewRenderView.setCurrentContent(contentViewCore, shellView. getViewRoot());
126 contentViewCore.onShow(); 126 contentViewCore.onShow();
127 } 127 }
128 } 128 }
129 129
130 @CalledByNative 130 @CalledByNative
131 private void removeShell(Shell shellView) { 131 private void removeShell(Shell shellView) {
132 if (shellView == mActiveShell) mActiveShell = null; 132 if (shellView == mActiveShell) mActiveShell = null;
133 if (shellView.getParent() == null) return; 133 if (shellView.getParent() == null) return;
134 ContentViewCore contentViewCore = shellView.getContentViewCore(); 134 ContentViewCore contentViewCore = shellView.getContentViewCore();
135 if (contentViewCore != null) contentViewCore.onHide(); 135 if (contentViewCore != null) contentViewCore.onHide();
136 shellView.setContentViewRenderView(null); 136 shellView.setContentViewRenderView(null);
137 removeView(shellView); 137 removeView(shellView);
138 } 138 }
139 139
140 /** 140 /**
141 * Destroys the Shell manager and associated components. 141 * Destroys the Shell manager and associated components.
142 */ 142 */
143 public void destroy() { 143 public void destroy() {
144 // Remove active shell (Currently single shell support only available). 144 // Remove active shell (Currently single shell support only available).
145 removeShell(mActiveShell); 145 removeShell(mActiveShell);
146 mContentViewRenderView.destroy(); 146 mContentViewRenderView.destroy();
147 mContentViewRenderView = null; 147 mContentViewRenderView = null;
148 } 148 }
149 149
150 private static native void nativeInit(Object shellManagerInstance); 150 private static native void nativeInit(Object shellManagerInstance);
151 private static native void nativeLaunchShell(String url); 151 private static native void nativeLaunchShell(String url);
152 } 152 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698