diff options
author | Jonathan Dixon <joth@google.com> | 2012-02-24 00:13:06 +0000 |
---|---|---|
committer | Jonathan Dixon <joth@google.com> | 2012-03-02 11:18:30 +0000 |
commit | 4d2fcaba7fb8eb1723943ac9a10e76d509330bd1 (patch) | |
tree | 19a8905db9aa0aad4a60c1c3ef4fd7506c2089ad /src/com/android/browser/Controller.java | |
parent | f9a4c8405898fa55be50ee4b682f7e97b054a41f (diff) | |
download | packages_apps_Browser-4d2fcaba7fb8eb1723943ac9a10e76d509330bd1.zip packages_apps_Browser-4d2fcaba7fb8eb1723943ac9a10e76d509330bd1.tar.gz packages_apps_Browser-4d2fcaba7fb8eb1723943ac9a10e76d509330bd1.tar.bz2 |
Fixup browser to use WebView proxy
Has to escape out to WebViewClassic whenever it needs a hidden API.
Interdepends on https://android-git.corp.google.com/g/165608
Change-Id: Ic61dd7f57f75381864075605d5901f2688648cbd
Diffstat (limited to 'src/com/android/browser/Controller.java')
-rw-r--r-- | src/com/android/browser/Controller.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index f8811b2..923dfed 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -76,6 +76,7 @@ import android.webkit.WebChromeClient; import android.webkit.WebIconDatabase; import android.webkit.WebSettings; import android.webkit.WebView; +import android.webkit.WebViewClassic; import android.widget.Toast; import com.android.browser.IntentHandler.UrlData; @@ -351,7 +352,7 @@ public class Controller // Read JavaScript flags if it exists. String jsFlags = getSettings().getJsEngineFlags(); if (jsFlags.trim().length() != 0) { - getCurrentWebView().setJsFlags(jsFlags); + WebViewClassic.fromWebView(getCurrentWebView()).setJsFlags(jsFlags); } if (intent != null && BrowserActivity.ACTION_SHOW_BOOKMARKS.equals(intent.getAction())) { @@ -2147,7 +2148,7 @@ public class Controller } private static class SelectText implements OnMenuItemClickListener { - private WebView mWebView; + private WebViewClassic mWebView; public boolean onMenuItemClick(MenuItem item) { if (mWebView != null) { @@ -2157,7 +2158,7 @@ public class Controller } public SelectText(WebView webView) { - mWebView = webView; + mWebView = WebViewClassic.fromWebView(webView); } } @@ -2430,7 +2431,8 @@ public class Controller // In case the user enters nothing. if (url != null && url.length() != 0 && tab != null && view != null) { url = UrlUtils.smartUrlFilter(url); - if (!view.getWebViewClient().shouldOverrideUrlLoading(view, url)) { + if (!WebViewClassic.fromWebView(view).getWebViewClient(). + shouldOverrideUrlLoading(view, url)) { loadUrl(tab, url); } } @@ -2662,14 +2664,14 @@ public class Controller break; case KeyEvent.KEYCODE_A: if (ctrl) { - webView.selectAll(); + WebViewClassic.fromWebView(webView).selectAll(); return true; } break; // case KeyEvent.KEYCODE_B: // menu case KeyEvent.KEYCODE_C: if (ctrl) { - webView.copySelection(); + WebViewClassic.fromWebView(webView).copySelection(); return true; } break; |