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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 10969045: Revert 158067 - Remove native side of content_view_client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
===================================================================
--- content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (revision 158071)
+++ content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (working copy)
@@ -32,7 +32,6 @@
import org.chromium.content.browser.ContentViewGestureHandler;
import org.chromium.content.browser.ContentViewGestureHandler.MotionEventDelegate;
import org.chromium.content.browser.TouchPoint;
-import org.chromium.content.browser.WebContentsObserverAndroid;
import org.chromium.content.browser.ZoomManager;
import org.chromium.content.common.CleanupReference;
import org.chromium.content.common.TraceEvent;
@@ -142,8 +141,11 @@
private final Context mContext;
private ViewGroup mContainerView;
private InternalAccessDelegate mContainerViewInternals;
- private WebContentsObserverAndroid mWebContentsObserver;
+ // content_view_client.cc depends on ContentViewCore.java holding a ref to the current client
+ // instance since the native side only holds a weak pointer to the client. We chose this
+ // solution over the managed object owning the C++ object's memory since it's a lot simpler
+ // in terms of clean up.
private ContentViewClient mContentViewClient;
private ContentSettings mContentSettings;
@@ -191,7 +193,7 @@
private boolean mKeyboardConnected;
// The AccessibilityInjector that handles loading Accessibility scripts into the web page.
- private AccessibilityInjector mAccessibilityInjector;
+ private final AccessibilityInjector mAccessibilityInjector;
private boolean mNeedUpdateOrientationChanged;
@@ -247,6 +249,9 @@
AndroidBrowserProcess.initContentViewProcess(
context, AndroidBrowserProcess.MAX_RENDERERS_SINGLE_PROCESS);
+ mAccessibilityInjector = AccessibilityInjector.newInstance(this);
+ mAccessibilityInjector.addOrRemoveAccessibilityApisIfNecessary();
+
mPersonality = personality;
HeapStatsLogger.init(mContext.getApplicationContext());
}
@@ -332,10 +337,6 @@
setAllUserAgentOverridesInHistory();
}
-
- mAccessibilityInjector = AccessibilityInjector.newInstance(this);
- mAccessibilityInjector.addOrRemoveAccessibilityApisIfNecessary();
-
String contentDescription = "Web View";
if (AppResource.STRING_CONTENT_VIEW_CONTENT_DESCRIPTION == 0) {
Log.w(TAG, "Setting contentDescription to 'Web View' as no value was specified.");
@@ -344,12 +345,6 @@
AppResource.STRING_CONTENT_VIEW_CONTENT_DESCRIPTION);
}
mContainerView.setContentDescription(contentDescription);
- mWebContentsObserver = new WebContentsObserverAndroid(this) {
- @Override
- public void didStartLoading(String url) {
- hidePopupDialog();
- }
- };
}
/**
@@ -476,6 +471,9 @@
throw new IllegalArgumentException("The client can't be null.");
}
mContentViewClient = client;
+ if (mNativeContentViewCore != 0) {
+ nativeSetClient(mNativeContentViewCore, mContentViewClient);
+ }
}
ContentViewClient getContentViewClient() {
@@ -1413,6 +1411,8 @@
private native void nativeSelectPopupMenuItems(int nativeContentViewCoreImpl, int[] indices);
+ private native void nativeSetClient(int nativeContentViewCoreImpl, ContentViewClient client);
+
private native boolean nativeNeedsReload(int nativeContentViewCoreImpl);
private native void nativeClearHistory(int nativeContentViewCoreImpl);
Property changes on: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
___________________________________________________________________
Added: svn:mergeinfo

Powered by Google App Engine
This is Rietveld 408576698