diff options
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/browser/Controller.java | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index aabdb26..83bbc63 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -1193,7 +1193,15 @@ public class Controller menu.setGroupVisible(R.id.ANCHOR_MENU, type == WebView.HitTestResult.SRC_ANCHOR_TYPE || type == WebView.HitTestResult.SRC_IMAGE_ANCHOR_TYPE); - + boolean hitText = type == WebView.HitTestResult.SRC_ANCHOR_TYPE + || type == WebView.HitTestResult.PHONE_TYPE + || type == WebView.HitTestResult.EMAIL_TYPE + || type == WebView.HitTestResult.GEO_TYPE; + menu.setGroupVisible(R.id.SELECT_TEXT_MENU, hitText); + if (hitText) { + menu.findItem(R.id.select_text_menu_id) + .setOnMenuItemClickListener(new SelectText(webview)); + } // Setup custom handling depending on the type switch (type) { case WebView.HitTestResult.PHONE_TYPE: @@ -1884,6 +1892,22 @@ public class Controller } } + private static class SelectText implements OnMenuItemClickListener { + private WebView mWebView; + + public boolean onMenuItemClick(MenuItem item) { + if (mWebView != null) { + return mWebView.selectText(); + } + return false; + } + + public SelectText(WebView webView) { + mWebView = webView; + } + + } + /********************** TODO: UI stuff *****************************/ // these methods have been copied, they still need to be cleaned up |