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

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

Issue 335293002: Dismiss WebsiteSettings when a new page is committed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: also fix chrome-layer tests Created 6 years, 6 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/WebContentsObserverAndroid.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/WebContentsObserverAndroid.java b/content/public/android/java/src/org/chromium/content/browser/WebContentsObserverAndroid.java
index b497d90d08f867109cadf3d77df0dbdf4ad25d76..73a9f59e6ec76113ff0ccef1af33178e83221cf1 100644
--- a/content/public/android/java/src/org/chromium/content/browser/WebContentsObserverAndroid.java
+++ b/content/public/android/java/src/org/chromium/content/browser/WebContentsObserverAndroid.java
@@ -6,6 +6,8 @@ package org.chromium.content.browser;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
+import org.chromium.base.ThreadUtils;
+import org.chromium.content_public.browser.WebContents;
/**
* This class receives callbacks that act as hooks for various a native web contents events related
@@ -15,8 +17,14 @@ import org.chromium.base.JNINamespace;
public abstract class WebContentsObserverAndroid {
private long mNativeWebContentsObserverAndroid;
+ // TODO(yfriedman): Switch everyone to use the WebContents constructor.
public WebContentsObserverAndroid(ContentViewCore contentViewCore) {
- mNativeWebContentsObserverAndroid = nativeInit(contentViewCore.getNativeContentViewCore());
+ this(contentViewCore.getWebContents());
+ }
+
+ public WebContentsObserverAndroid(WebContents webContents) {
+ ThreadUtils.assertOnUiThread();
+ mNativeWebContentsObserverAndroid = nativeInit(webContents);
}
@CalledByNative
@@ -165,6 +173,6 @@ public abstract class WebContentsObserverAndroid {
}
}
- private native long nativeInit(long contentViewCorePtr);
+ private native long nativeInit(WebContents webContents);
private native void nativeDestroy(long nativeWebContentsObserverAndroid);
}

Powered by Google App Engine
This is Rietveld 408576698