OSDN Git Service

Clear omnibox when pressing search key.
authorLeon Scroggins <scroggo@google.com>
Tue, 16 Feb 2010 17:33:55 +0000 (12:33 -0500)
committerLeon Scroggins <scroggo@google.com>
Tue, 16 Feb 2010 17:33:55 +0000 (12:33 -0500)
Fix for http://b/issue?id=2442426

No longer override onSearchRequested, so that pressing the search
key behaves normally.  For touching the title bar, use the old
onSearchRequested (renamed to editUrl).

src/com/android/browser/BrowserActivity.java
src/com/android/browser/TitleBar.java

index 22ac914..0688e36 100644 (file)
@@ -1348,18 +1348,16 @@ public class BrowserActivity extends Activity
         return bundle;
     }
 
-    /**
-     * Overriding this to insert a local information bundle
-     */
-    @Override
-    public boolean onSearchRequested() {
+    /* package */ void editUrl() {
         if (mOptionsMenuOpen) closeOptionsMenu();
         String url = (getTopWindow() == null) ? null : getTopWindow().getUrl();
         startSearch(mSettings.getHomePage().equals(url) ? null : url, true,
-                createGoogleSearchSourceBundle(GOOGLE_SEARCH_SOURCE_SEARCHKEY), false);
-        return true;
+                null, false);
     }
 
+    /**
+     * Overriding this to insert a local information bundle
+     */
     @Override
     public void startSearch(String initialQuery, boolean selectInitialQuery,
             Bundle appSearchData, boolean globalSearch) {
@@ -1469,7 +1467,7 @@ public class BrowserActivity extends Activity
                 break;
 
             case R.id.goto_menu_id:
-                onSearchRequested();
+                editUrl();
                 break;
 
             case R.id.bookmarks_menu_id:
index 844d5a1..15b1d44 100644 (file)
@@ -220,7 +220,7 @@ public class TitleBar extends LinearLayout {
                         mBrowserActivity.showVoiceSearchResults(
                                 mTitle.getText().toString().trim());
                     } else {
-                        mBrowserActivity.onSearchRequested();
+                        mBrowserActivity.editUrl();
                     }
                     mTitleBg.setPressed(false);
                 }