Bug 1053994 - Made changes to recognize bookmark keywork on search. r=bnicholson
authorVikneshwar <lviknesh@gmail.com>
Mon, 15 Sep 2014 12:09:00 +0200
changeset 208162 d472f51a9ce40ff8a8cd59bd5ae0a22e0eb15376
parent 208161 8292582e4c69b11e25fd29a2b20d2dd1dee44cf2
child 208163 b30d47d94a85ac717dbd0b8942f435b195b2c42f
push id27579
push userkwierso@gmail.com
push dateWed, 01 Oct 2014 23:02:13 +0000
treeherderautoland@f771fd927304 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbnicholson
bugs1053994
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1053994 - Made changes to recognize bookmark keywork on search. r=bnicholson
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -940,17 +940,17 @@ public class BrowserApp extends GeckoApp
     }
 
     @Override
     public boolean onContextItemSelected(MenuItem item) {
         final int itemId = item.getItemId();
         if (itemId == R.id.pasteandgo) {
             String text = Clipboard.getText();
             if (!TextUtils.isEmpty(text)) {
-                Tabs.getInstance().loadUrl(text);
+                loadUrlOrKeywordSearch(text);
                 Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.CONTEXT_MENU);
                 Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.CONTEXT_MENU, "pasteandgo");
             }
             return true;
         }
 
         if (itemId == R.id.site_settings) {
             // This can be selected from either the browser menu or the contextmenu, depending on the size and version (v11+) of the phone.
@@ -1929,17 +1929,20 @@ public class BrowserApp extends GeckoApp
         // and exited without taking an action, no Views are displayed and graphical corruption is
         // visible instead.
         //
         // Here we call hideHomePager for the second time with the URL to be loaded so that
         // hideHomePager is called with the correct state for the upcoming page load.
         //
         // Expected to be fixed by bug 915825.
         hideHomePager(url);
-
+        loadUrlOrKeywordSearch(url);
+    }
+
+    private void loadUrlOrKeywordSearch(final String url) {
         // Don't do anything if the user entered an empty URL.
         if (TextUtils.isEmpty(url)) {
             return;
         }
 
         // If the URL doesn't look like a search query, just load it.
         if (!StringUtils.isSearchQuery(url, true)) {
             Tabs.getInstance().loadUrl(url, Tabs.LOADURL_USER_ENTERED);