| 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;
|
| }
|
|
|