diff options
author | Paul Miller <paulmiller@google.com> | 2015-02-12 14:17:51 -0800 |
---|---|---|
committer | Paul Miller <paulmiller@google.com> | 2015-02-12 14:17:51 -0800 |
commit | e6db7dcd06e8ea0dee6a476c03640dd61d9d54ae (patch) | |
tree | d85dc47d01dc3af888ee140c57cdf68b9d7fd60a /src/com/android/browser/Tab.java | |
parent | a9c8a585372f2c61270b515d4857a595012e0301 (diff) | |
download | packages_apps_Browser-e6db7dcd06e8ea0dee6a476c03640dd61d9d54ae.zip packages_apps_Browser-e6db7dcd06e8ea0dee6a476c03640dd61d9d54ae.tar.gz packages_apps_Browser-e6db7dcd06e8ea0dee6a476c03640dd61d9d54ae.tar.bz2 |
Show JS alerts over their origin tab
BUG:18416812
Change-Id: I25964690bdf579a4fd23fcb6e7c0f6681f0f3661
Diffstat (limited to 'src/com/android/browser/Tab.java')
-rw-r--r-- | src/com/android/browser/Tab.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java index a3e4a59..9734137 100644 --- a/src/com/android/browser/Tab.java +++ b/src/com/android/browser/Tab.java @@ -52,6 +52,8 @@ import android.webkit.CookieManager; import android.webkit.GeolocationPermissions; import android.webkit.GeolocationPermissions.Callback; import android.webkit.HttpAuthHandler; +import android.webkit.JsPromptResult; +import android.webkit.JsResult; import android.webkit.PermissionRequest; import android.webkit.SslErrorHandler; import android.webkit.URLUtil; @@ -789,6 +791,27 @@ class Tab implements PictureListener { } @Override + public boolean onJsAlert(WebView view, String url, String message, + JsResult result) { + mWebViewController.getTabControl().setActiveTab(Tab.this); + return false; + } + + @Override + public boolean onJsConfirm(WebView view, String url, String message, + JsResult result) { + mWebViewController.getTabControl().setActiveTab(Tab.this); + return false; + } + + @Override + public boolean onJsPrompt(WebView view, String url, String message, + String defaultValue, JsPromptResult result) { + mWebViewController.getTabControl().setActiveTab(Tab.this); + return false; + } + + @Override public void onProgressChanged(WebView view, int newProgress) { mPageLoadProgress = newProgress; if (newProgress == 100) { |