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

Side by Side Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 10947028: [Android] Fix WebView tests breakage after http://crrev.com/10916160 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Now really Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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.android_webview; 5 package org.chromium.android_webview;
6 6
7 import android.view.ViewGroup; 7 import android.view.ViewGroup;
8 import android.os.Message; 8 import android.os.Message;
9 9
10 import org.chromium.base.CalledByNative; 10 import org.chromium.base.CalledByNative;
11 import org.chromium.base.JNINamespace; 11 import org.chromium.base.JNINamespace;
12 import org.chromium.content.browser.ContentViewCore; 12 import org.chromium.content.browser.ContentViewCore;
13 import org.chromium.content.common.CleanupReference; 13 import org.chromium.content.common.CleanupReference;
14 import org.chromium.ui.gfx.NativeWindow;
14 15
15 /** 16 /**
16 * Exposes the native AwContents class, and together these classes wrap the Cont entViewCore 17 * Exposes the native AwContents class, and together these classes wrap the Cont entViewCore
17 * and Browser components that are required to implement Android WebView API. Th is is the 18 * and Browser components that are required to implement Android WebView API. Th is is the
18 * primary entry point for the WebViewProvider implementation; it holds a 1:1 ob ject 19 * primary entry point for the WebViewProvider implementation; it holds a 1:1 ob ject
19 * relationship with application WebView instances. 20 * relationship with application WebView instances.
20 * (We define this class independent of the hidden WebViewProvider interfaces, t o allow 21 * (We define this class independent of the hidden WebViewProvider interfaces, t o allow
21 * continuous build & test in the open source SDK-based tree). 22 * continuous build & test in the open source SDK-based tree).
22 */ 23 */
23 @JNINamespace("android_webview") 24 @JNINamespace("android_webview")
(...skipping 25 matching lines...) Expand all
49 * @param internalAccessAdapter to access private methods on containerView. 50 * @param internalAccessAdapter to access private methods on containerView.
50 * @param contentViewCore requires an existing but not yet initialized insta nce. Will be 51 * @param contentViewCore requires an existing but not yet initialized insta nce. Will be
51 * initialized on return. 52 * initialized on return.
52 * @param contentsClient will receive API callbacks from this WebView Conten ts 53 * @param contentsClient will receive API callbacks from this WebView Conten ts
53 * @param privateBrowsing whether this is a private browsing instance of Web View. 54 * @param privateBrowsing whether this is a private browsing instance of Web View.
54 * @param isAccessFromFileURLsGrantedByDefault passed to ContentViewCore.ini tialize. 55 * @param isAccessFromFileURLsGrantedByDefault passed to ContentViewCore.ini tialize.
55 */ 56 */
56 public AwContents(ViewGroup containerView, 57 public AwContents(ViewGroup containerView,
57 ContentViewCore.InternalAccessDelegate internalAccessAdapter, 58 ContentViewCore.InternalAccessDelegate internalAccessAdapter,
58 ContentViewCore contentViewCore, AwContentsClient contentsClient, 59 ContentViewCore contentViewCore, AwContentsClient contentsClient,
59 boolean privateBrowsing, boolean isAccessFromFileURLsGrantedByDefault) { 60 NativeWindow nativeWindow, boolean privateBrowsing,
61 boolean isAccessFromFileURLsGrantedByDefault) {
60 mNativeAwContents = nativeInit(contentsClient.getWebContentsDelegate(), pr ivateBrowsing); 62 mNativeAwContents = nativeInit(contentsClient.getWebContentsDelegate(), pr ivateBrowsing);
61 mContentViewCore = contentViewCore; 63 mContentViewCore = contentViewCore;
62 mContentsClient = contentsClient; 64 mContentsClient = contentsClient;
63 mCleanupReference = new CleanupReference(this, new DestroyRunnable(mNative AwContents)); 65 mCleanupReference = new CleanupReference(this, new DestroyRunnable(mNative AwContents));
64 66
65 // TODO: upstream the needed ContentViewCore initialization method. 67 // TODO: upstream the needed ContentViewCore initialization method.
66 // mContentViewCore.initialize(containerView, internalAccessAdapter, false , 68 // mContentViewCore.initialize(containerView, internalAccessAdapter, false ,
67 // nativeGetWebContents(mNativeAwContents), isAccessFromFileURLsGrante dByDefault); 69 // nativeGetWebContents(mNativeAwContents), nativeWindow,
70 // isAccessFromFileURLsGrantedByDefault);
68 mContentViewCore.setContentViewClient(contentsClient); 71 mContentViewCore.setContentViewClient(contentsClient);
69 } 72 }
70 73
71 public ContentViewCore getContentViewCore() { 74 public ContentViewCore getContentViewCore() {
72 return mContentViewCore; 75 return mContentViewCore;
73 } 76 }
74 77
75 public void destroy() { 78 public void destroy() {
76 if (mContentViewCore != null) { 79 if (mContentViewCore != null) {
77 mContentViewCore.destroy(); 80 mContentViewCore.destroy();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 //-------------------------------------------------------------------------- ------------------ 119 //-------------------------------------------------------------------------- ------------------
117 120
118 private native int nativeInit(AwWebContentsDelegate webViewWebContentsDelega te, 121 private native int nativeInit(AwWebContentsDelegate webViewWebContentsDelega te,
119 boolean privateBrowsing); 122 boolean privateBrowsing);
120 private static native void nativeDestroy(int nativeAwContents); 123 private static native void nativeDestroy(int nativeAwContents);
121 124
122 private native int nativeGetWebContents(int nativeAwContents); 125 private native int nativeGetWebContents(int nativeAwContents);
123 126
124 private native void nativeDocumentHasImages(int nativeAwContents, Message me ssage); 127 private native void nativeDocumentHasImages(int nativeAwContents, Message me ssage);
125 } 128 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698