diff options
author | Ben Murdoch <benm@google.com> | 2013-08-19 20:34:43 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2013-08-20 11:29:50 +0100 |
commit | 33e1eeae98299666b8c2d1e879f92d1c83fe33fb (patch) | |
tree | 1ec6b03b9207b51e0f63148529836b44fb275d87 /chromium/java/com/android/webview | |
parent | e9542c07dd10a17adf5df9dbb421a99db05083ce (diff) | |
download | webview-33e1eeae98299666b8c2d1e879f92d1c83fe33fb.tar.gz |
Show visible feedback that private browsing not supported.
Cherry pick of
https://googleplex-android-review.googlesource.com/#/c/345036/
As well as a message in logcat, provide visual feedback that the
WebView no longer supports private browsing when an app attempts
to create one.
Bug: 7390806
Change-Id: Ife5af3968bd830bedc49fe217df523a05bcd016d
Diffstat (limited to 'chromium/java/com/android/webview')
-rw-r--r-- | chromium/java/com/android/webview/chromium/WebViewChromium.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chromium/java/com/android/webview/chromium/WebViewChromium.java b/chromium/java/com/android/webview/chromium/WebViewChromium.java index a318b45..087fa9b 100644 --- a/chromium/java/com/android/webview/chromium/WebViewChromium.java +++ b/chromium/java/com/android/webview/chromium/WebViewChromium.java @@ -50,6 +50,7 @@ import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.webkit.WebViewProvider; +import android.widget.TextView; import org.chromium.android_webview.AwBrowserContext; import org.chromium.android_webview.AwContents; @@ -128,7 +129,7 @@ class WebViewChromium implements WebViewProvider, if (privateBrowsing) { final String msg = "Private browsing is not supported in WebView."; - if (mAppTargetSdkVersion >= Build.VERSION_CODES.KEY_LIME_PIE) { + if (mAppTargetSdkVersion >= Build.VERSION_CODES.KEY_LIME_PIE) { throw new IllegalArgumentException(msg); } else { Log.w(TAG, msg); @@ -136,6 +137,10 @@ class WebViewChromium implements WebViewProvider, // user data cannot leak through misuse of a non-privateBrowing WebView instance. // Can't just null out mAwContents as we never null-check it before use. mAwContents.destroy(); + TextView warningLabel = new TextView(mWebView.getContext()); + warningLabel.setText(mWebView.getContext().getString( + com.android.internal.R.string.webviewchromium_private_browsing_warning)); + mWebView.addView(warningLabel); } } |