Chromium Code Reviews| Index: android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java |
| diff --git a/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java b/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java |
| index 3f2c707dce8447bc8b0abc5a24dc508ac6b8c1b2..5e37d992ca24f1353d006c4381410dfc10e1f31c 100644 |
| --- a/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java |
| +++ b/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java |
| @@ -11,6 +11,7 @@ import android.os.AsyncTask; |
| import android.os.Handler; |
| import android.os.Message; |
| import android.provider.MediaStore; |
| +import android.text.TextUtils; |
| import android.util.Log; |
| import android.view.KeyEvent; |
| import android.view.View; |
| @@ -19,6 +20,7 @@ import android.webkit.ValueCallback; |
| import org.chromium.base.ContentUriUtils; |
| import org.chromium.base.ThreadUtils; |
| +import org.chromium.content_public.browser.InvalidateTypes; |
| /** |
| * Adapts the AwWebContentsDelegate interface to the AwContentsClient interface. |
| @@ -213,6 +215,22 @@ class AwWebContentsDelegateAdapter extends AwWebContentsDelegate { |
| } |
| @Override |
| + public void navigationStateChanged(int flags) { |
| + if ((flags & InvalidateTypes.URL) != 0 |
| + && mAwContents.hasAccessedInitialDocument() |
| + && mAwContents.getDidAttemptLoad()) { |
|
Charlie Reis
2015/03/02 23:09:31
I don't think we need this, do we? It seems like
mnaganov (inactive)
2015/03/03 08:55:48
Indeed, my initial plan was to just use GetPending
|
| + // Hint the client to show the last committed url, as it may be unsafe to show |
| + // the pending entry. |
| + String url = mAwContents.getLastCommittedUrl(); |
| + url = TextUtils.isEmpty(url) ? "about:blank" : url; |
| + mContentsClient.onPageStarted(url); |
| + mContentsClient.onLoadResource(url); |
| + mContentsClient.onProgressChanged(100); |
| + mContentsClient.onPageFinished(url); |
| + } |
| + } |
| + |
| + @Override |
| public void toggleFullscreenModeForTab(boolean enterFullscreen) { |
| if (enterFullscreen) { |
| mContentViewClient.enterFullscreen(); |