/** callback from suggestion dropdown user selected a suggestion */ @Override public void onAction(String text, String extra, String source) { mUiController.getCurrentTopWebView().requestFocus(); if (UrlInputView.TYPED.equals(source)) { String url = UrlUtils.smartUrlFilter(text, false); Tab t = mBaseUi.getActiveTab(); // Only shortcut javascript URIs for now, as there is special // logic in UrlHandler for other schemas if (url != null && t != null && url.startsWith("javascript:")) { mUiController.loadUrl(t, url); setDisplayTitle(text); return; } } Intent i = new Intent(); String action = null; if (UrlInputView.VOICE.equals(source)) { action = RecognizerResultsIntent.ACTION_VOICE_SEARCH_RESULTS; source = null; } else { action = Intent.ACTION_SEARCH; } i.setAction(action); i.putExtra(SearchManager.QUERY, text); if (extra != null) { i.putExtra(SearchManager.EXTRA_DATA_KEY, extra); } if (source != null) { Bundle appData = new Bundle(); appData.putString(com.android.common.Search.SOURCE, source); i.putExtra(SearchManager.APP_DATA, appData); } mUiController.handleNewIntent(i); setDisplayTitle(text); }