diff options
author | benm@chromium.org <benm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-06 13:48:57 +0000 |
---|---|---|
committer | benm@chromium.org <benm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-06 13:48:57 +0000 |
commit | 17c264cb5bc2d30ee0925227055a2adc13e31196 (patch) | |
tree | 95538c26f71567cc502731c59c4c2919d49176e2 /android_webview | |
parent | 1af814da23c5190c226ccee2a073c6ef1765778d (diff) | |
download | chromium_src-17c264cb5bc2d30ee0925227055a2adc13e31196.zip chromium_src-17c264cb5bc2d30ee0925227055a2adc13e31196.tar.gz chromium_src-17c264cb5bc2d30ee0925227055a2adc13e31196.tar.bz2 |
[Android WebView] AwContents now owns ContentViewCore.
Previously a ContentViewCore was injected into AwContents by
the embedder. This is no longer necessary and AwContents can take
ownership of it.
Android bots happy
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11363100
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166204 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview')
3 files changed, 14 insertions, 19 deletions
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java index 9f9c222..a85bba7 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java @@ -145,19 +145,18 @@ public class AwContents { /** * @param containerView the view-hierarchy item this object will be bound to. * @param internalAccessAdapter to access private methods on containerView. - * @param contentViewCore requires an existing but not yet initialized instance. Will be - * initialized on return. * @param contentsClient will receive API callbacks from this WebView Contents * @param privateBrowsing whether this is a private browsing instance of WebView. * @param isAccessFromFileURLsGrantedByDefault passed to ContentViewCore.initialize. */ public AwContents(ViewGroup containerView, ContentViewCore.InternalAccessDelegate internalAccessAdapter, - ContentViewCore contentViewCore, AwContentsClient contentsClient, + AwContentsClient contentsClient, NativeWindow nativeWindow, boolean privateBrowsing, boolean isAccessFromFileURLsGrantedByDefault) { mNativeAwContents = nativeInit(contentsClient.getWebContentsDelegate(), privateBrowsing); - mContentViewCore = contentViewCore; + mContentViewCore = new ContentViewCore(containerView.getContext(), + ContentViewCore.PERSONALITY_VIEW); mContentsClient = contentsClient; mCleanupReference = new CleanupReference(this, new DestroyRunnable(mNativeAwContents)); mIoThreadClientHandler = new IoThreadClientHandler(); diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java index c516b96..19b205e 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java @@ -192,11 +192,9 @@ public class AndroidWebViewTestBase protected AwTestContainerView createAwTestContainerView(final boolean incognito, final AwTestContainerView testContainerView, final AwContentsClient awContentsClient) { - ContentViewCore contentViewCore = new ContentViewCore( - getActivity(), ContentViewCore.PERSONALITY_VIEW); - testContainerView.initialize(contentViewCore, - new AwContents(testContainerView, testContainerView.getInternalAccessDelegate(), - contentViewCore, awContentsClient, new ActivityNativeWindow(getActivity()), + testContainerView.initialize(new AwContents(testContainerView, + testContainerView.getInternalAccessDelegate(), + awContentsClient, new ActivityNativeWindow(getActivity()), incognito, false)); getActivity().addView(testContainerView); return testContainerView; diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestContainerView.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestContainerView.java index 917b1ac..0e48a75b 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestContainerView.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestContainerView.java @@ -24,7 +24,6 @@ import org.chromium.content.browser.ContentViewCore; * This class takes the place android.webkit.WebView would have in the production configuration. */ class AwTestContainerView extends FrameLayout { - private ContentViewCore mContentViewCore; private AwContents mAwContents; private ContentViewCore.InternalAccessDelegate mInternalAccessDelegate; @@ -33,13 +32,12 @@ class AwTestContainerView extends FrameLayout { mInternalAccessDelegate = new InternalAccessAdapter(); } - public void initialize(ContentViewCore contentViewCore, AwContents awContents) { - mContentViewCore = contentViewCore; + public void initialize(AwContents awContents) { mAwContents = awContents; } public ContentViewCore getContentViewCore() { - return mContentViewCore; + return mAwContents.getContentViewCore(); } public AwContents getAwContents() { @@ -58,33 +56,33 @@ class AwTestContainerView extends FrameLayout { /* @Override public void onConfigurationChanged(Configuration newConfig) { - mContentViewCore.onConfigurationChanged(newConfig); + mAwContents.getContentViewCore().onConfigurationChanged(newConfig); } @Override public void onAttachedToWindow() { - mContentViewCore.onAttachedToWindow(); + mAwContents.getContentViewCore().onAttachedToWindow(); } @Override public void onDetachedFromWindow() { - mContentViewCore.onDetachedFromWindow(); + mAwContents.getContentViewCore().onDetachedFromWindow(); } @Override public void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) { - mContentViewCore.onFocusChanged(focused, direction, previouslyFocusedRect); + mAwContents.getContentViewCore().onFocusChanged(focused, direction, previouslyFocusedRect); } @Override public void onSizeChanged(int w, int h, int ow, int oh) { - mContentViewCore.onSizeChanged(w, h, ow, oh); + mAwContents.getContentViewCore().onSizeChanged(w, h, ow, oh); } */ @Override public boolean onTouchEvent(MotionEvent ev) { - return mContentViewCore.onTouchEvent(ev); + return mAwContents.getContentViewCore().onTouchEvent(ev); } // TODO: ContentViewCore could define a generic class that holds an implementation similar to |