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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java

Issue 2598163002: WebContentsObserver update for PlzNavigate methods (Closed)
Patch Set: Revert back a state CHECK Created 4 years 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContent.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java b/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java
index 9a444fef9b00c0c7c53fbc506336eb7e4d43cc5c..dab820a535e4d213eb2ee51154f587057769261a 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java
@@ -87,11 +87,17 @@ public class AwWebContentsObserver extends WebContentsObserver {
}
@Override
- public void didNavigateMainFrame(final String url, String baseUrl,
- boolean isNavigationToDifferentPage, boolean isFragmentNavigation, int statusCode) {
+ public void didFinishNavigation(final String url, boolean isInMainFrame, boolean isErrorPage,
+ boolean hasCommitted, boolean isSamePage, boolean isReload) {
+ mCommittedNavigation = true;
+ AwContentsClient client = mAwContentsClient.get();
+ if (client != null) {
+ client.getCallbackHelper().postDoUpdateVisitedHistory(url, isReload);
+ }
+
// Only invoke the onPageCommitVisible callback when navigating to a different page,
// but not when navigating to a different fragment within the same page.
- if (isNavigationToDifferentPage) {
+ if (isInMainFrame && !isSamePage) {
ThreadUtils.postOnUiThread(new Runnable() {
@Override
public void run() {
@@ -113,21 +119,11 @@ public class AwWebContentsObserver extends WebContentsObserver {
// This is here to emulate the Classic WebView firing onPageFinished for main frame
// navigations where only the hash fragment changes.
- if (isFragmentNavigation) {
- AwContentsClient client = mAwContentsClient.get();
- if (client == null) return;
+ if (isSamePage && client != null) {
client.getCallbackHelper().postOnPageFinished(url);
}
}
- @Override
- public void didNavigateAnyFrame(String url, String baseUrl, boolean isReload) {
- mCommittedNavigation = true;
- final AwContentsClient client = mAwContentsClient.get();
- if (client == null) return;
- client.getCallbackHelper().postDoUpdateVisitedHistory(url, isReload);
- }
-
public boolean didEverCommitNavigation() {
return mCommittedNavigation;
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContent.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698