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

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

Issue 10963041: Revert "Revert 158067 - Remove native side of content_view_client" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add additional_input_paths as a variable and input to java.gypi 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
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 9aa145fd4e139148653cc8204379b13e034570ff..afc3583a7efb09c673579b780eac0195d879d352 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -32,6 +32,7 @@ import org.chromium.content.browser.accessibility.AccessibilityInjector;
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;
@@ -141,11 +142,8 @@ public class ContentViewCore implements MotionEventDelegate {
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;
@@ -193,7 +191,7 @@ public class ContentViewCore implements MotionEventDelegate {
private boolean mKeyboardConnected;
// The AccessibilityInjector that handles loading Accessibility scripts into the web page.
- private final AccessibilityInjector mAccessibilityInjector;
+ private AccessibilityInjector mAccessibilityInjector;
private boolean mNeedUpdateOrientationChanged;
@@ -249,9 +247,6 @@ public class ContentViewCore implements MotionEventDelegate {
AndroidBrowserProcess.initContentViewProcess(
context, AndroidBrowserProcess.MAX_RENDERERS_SINGLE_PROCESS);
- mAccessibilityInjector = AccessibilityInjector.newInstance(this);
- mAccessibilityInjector.addOrRemoveAccessibilityApisIfNecessary();
-
mPersonality = personality;
HeapStatsLogger.init(mContext.getApplicationContext());
}
@@ -337,6 +332,10 @@ public class ContentViewCore implements MotionEventDelegate {
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.");
@@ -345,6 +344,12 @@ public class ContentViewCore implements MotionEventDelegate {
AppResource.STRING_CONTENT_VIEW_CONTENT_DESCRIPTION);
}
mContainerView.setContentDescription(contentDescription);
+ mWebContentsObserver = new WebContentsObserverAndroid(this) {
+ @Override
+ public void didStartLoading(String url) {
+ hidePopupDialog();
+ }
+ };
}
/**
@@ -471,9 +476,6 @@ public class ContentViewCore implements MotionEventDelegate {
throw new IllegalArgumentException("The client can't be null.");
}
mContentViewClient = client;
- if (mNativeContentViewCore != 0) {
- nativeSetClient(mNativeContentViewCore, mContentViewClient);
- }
}
ContentViewClient getContentViewClient() {
@@ -1411,8 +1413,6 @@ public class ContentViewCore implements MotionEventDelegate {
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);

Powered by Google App Engine
This is Rietveld 408576698