From feb46c81dbf7c74610dbc53df7c49df8f78d9a65 Mon Sep 17 00:00:00 2001 From: "mconnor%steelgryphon.com" Date: Mon, 15 May 2006 14:31:21 +0000 Subject: [PATCH] land bug 337178 on the trunk, incl bustage fixes r=gavin on the main parts, me on the bustage-ish parts git-svn-id: svn://10.0.0.236/trunk@196523 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/browser/components/search/Makefile.in | 3 ++- .../components/search/content/search.xml | 27 +++++++++++++++++++ .../search/nsIBrowserSearchService.idl | 7 ++++- .../components/search/nsSearchService.js | 18 +++++++++++-- .../locales/en-US/searchplugins/google.xml | 1 + .../locales/en-US/searchplugins/yahoo.xml | 1 + 6 files changed, 53 insertions(+), 4 deletions(-) diff --git a/mozilla/browser/components/search/Makefile.in b/mozilla/browser/components/search/Makefile.in index d35ecfa96fd..8967c6ef3a3 100644 --- a/mozilla/browser/components/search/Makefile.in +++ b/mozilla/browser/components/search/Makefile.in @@ -48,6 +48,7 @@ XPIDL_MODULE = browsersearch XPIDLSRCS = nsIBrowserSearchService.idl -EXTRA_PP_COMPONENTS = nsSearchService.js +EXTRA_PP_COMPONENTS = nsSearchService.js \ + nsSearchSuggestions.js include $(topsrcdir)/config/rules.mk diff --git a/mozilla/browser/components/search/content/search.xml b/mozilla/browser/components/search/content/search.xml index 7e3d5c094e5..d98e45f3c2a 100644 --- a/mozilla/browser/components/search/content/search.xml +++ b/mozilla/browser/components/search/content/search.xml @@ -115,6 +115,9 @@ Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); os.addObserver(this, "browser-search-engine-modified", false); + + // make sure we're using the right autocomplete + this._updateAutocompleteSearch(); ]]> @@ -122,6 +125,10 @@ var os = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); os.removeObserver(this, "browser-search-engine-modified"); + + // Make sure to break the cycle from _texbox to us. Otherwise we leak + // the world. + this._textbox.mController.input = null; ]]> document.getAnonymousElementByAttribute(this, "anonid", "searchbar-stringbundle"); @@ -362,11 +369,31 @@ if (newIndex >= 0 && newIndex < this._engines.length) this.currentEngine = this._engines[newIndex]; + this._updateAutocompleteSearch() + aEvent.preventDefault(); aEvent.stopPropagation(); ]]> + + + + 0), @@ -1507,6 +1510,13 @@ Engine.prototype = { closeSafeOutputStream(fos); }, + _createSuggestionURI: function SRCH_ENG_createSuggestionURI (aURLString) { + var suggestionURI = makeURI(aURLString, this._queryCharset); + if (suggestionURI && + (suggestionURI.schemeIs("http") || suggestionURI.schemeIs("https"))) + this._suggestionURI = suggestionURI; + }, + /** * Remove the engine's file from disk. The search service calls this once it * removes the engine from its internal store. This function will throw if @@ -1555,6 +1565,10 @@ Engine.prototype = { } }, + get suggestionURI() { + return this._suggestionURI; + }, + get iconURI() { return this._iconURI; }, diff --git a/mozilla/browser/locales/en-US/searchplugins/google.xml b/mozilla/browser/locales/en-US/searchplugins/google.xml index 712126f4253..597be3946a9 100755 --- a/mozilla/browser/locales/en-US/searchplugins/google.xml +++ b/mozilla/browser/locales/en-US/searchplugins/google.xml @@ -3,6 +3,7 @@ Google Search UTF-8 data:image/x-icon;base64,R0lGODlhEAAQAPfLAAATVikwdA8SnxUfgAsWpAAilholjxw4jBc7kwAlvQQ2sRMsoBUqqhMzuhY/vxw4tSgmiyM1mSUztiQ6sTE3sQ4qyxMxxRoyxiAuxR1CtBxJsBxasSJuuTFguBte0Rlf2xVc9h9W9xVjzxVr0gdj6BRh4R1o5yBcyiZbyydT1i9b2Ddb1iFY6CJg2Vpor1dzvEJu20Z0yi23QDy1REi2OUy0O1WzOVC4PU+tVUe5Sk2xQU2zRUO4UE21Ula2SmKEqWWF2HyPx2+a6X6e6Xqk1m+s78sUDs4UGdEQB9YfDdwaANEfHd0YEscjAM4mAM0qANIoD9IkGdslGswuItYgL4aP0ImP2YGZ36Opzaq2wq/S+rzX/7/e8MrS1MLO/sTb48rT8snX/83c89PZ+crq+cH1/9Dl/9Ln/93r/9fy/+Hf7P/42eDm/O7u/+T29uX2/eT2/+f4/+f5/+j/9u//8+3/9u7/9ur5/+j//+n//+v//u3//+7//e7//+////b66/T/6vX/6/f/7f/07fj/4fv/4Pj/5v/45v7/4/r+7/3/6fDw+Pfx//D/9/X/8fT/8/f/8ff/8/D///H///L8/fL///P///X7//b6/ff/+/T///b9//f///v19//w9v/09P/29v/x+f/y///z///1+v/1///2///3//j79P/58/z/8/z99/z/9v7/9P7/9vn7//v6//j9//n9//j///n///v//vv////4+v/5+//6+P/4///6/P/6/v/6///7///9+P/8+v/9+v7/+Pz////8/f/9/f79///8///9//7//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAMsALAAAAAAQABAAAAj/AEn4oIFjBw8bOnrMuJGjhowZM1T8UdYJUZ5ZcNRYWjSrVK5QU0DMmtUnzRAXEy4o6FCEy6NDTkQIq1MmRgM0eZTlCXMgQJtRSE4gmgUkwh1EiZTNUiamy6NUUExcuoJgDCdDjQg9KgVL2SNFT1hwEvKglLBWuixZ+jSrlSBdRlL04bBBkTBdpZTpIqWsFaBcTEr0QaEhl6dWlswKW6poDRUPlmAUQKWMkTJLc76QMQNGUZMWgIgkCFJnlq5WXigwkFClVZQQyuRgELAlk7JBymCZGYAF0ZEPrQixgUDAihxVdPpoAZAFUZIRfThxgvPCwAILDipk+OFG2ZIVoxApERtPfvwlvZ+kQFzPvv0MJQEBADs= +http://www.google.com/complete/search?csv=t&qu= diff --git a/mozilla/browser/locales/en-US/searchplugins/yahoo.xml b/mozilla/browser/locales/en-US/searchplugins/yahoo.xml index ee6701410cf..9c51852142b 100755 --- a/mozilla/browser/locales/en-US/searchplugins/yahoo.xml +++ b/mozilla/browser/locales/en-US/searchplugins/yahoo.xml @@ -2,6 +2,7 @@ Yahoo Yahoo Search UTF-8 +http://ff.search.yahoo.com/gossip?output=fxjson&command= data:image/x-icon;base64,R0lGODlhEAAQAJECAP8AAAAAAP///wAAACH5BAEAAAIALAAAAAAQABAAAAIplI+py+0NogQuyBDEnEd2kHkfFWUamEzmpZSfmaIHPHrRguUm/fT+UwAAOw==