From aa54933ea97f9fbebd1f6e0f5adb82b46282c70d Mon Sep 17 00:00:00 2001 From: "pamg.bugs%gmail.com" Date: Thu, 10 Aug 2006 21:16:13 +0000 Subject: [PATCH] Bug 348141: Adding an autodetected search engine should choose it too. r=beng, r (on irc)=gavin --- browser/components/search/content/search.xml | 8 ++++---- browser/components/search/nsIBrowserSearchService.idl | 9 ++++++--- browser/components/search/nsSearchService.js | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/browser/components/search/content/search.xml b/browser/components/search/content/search.xml index 944b68ab64c6..1b5d78064279 100644 --- a/browser/components/search/content/search.xml +++ b/browser/components/search/content/search.xml @@ -434,11 +434,11 @@ searchService.addEngine(aTarget.getAttribute("uri"), type, aTarget.getAttribute("src"), false); } - else if (aTarget.engine) { + else if (aTarget.engine) this.currentEngine = aTarget.engine; - this.focus(); - this.select(); - } + + this.focus(); + this.select(); ]]> diff --git a/browser/components/search/nsIBrowserSearchService.idl b/browser/components/search/nsIBrowserSearchService.idl index b6722b9b1107..c2593706c6c2 100755 --- a/browser/components/search/nsIBrowserSearchService.idl +++ b/browser/components/search/nsIBrowserSearchService.idl @@ -167,8 +167,10 @@ interface nsIBrowserSearchService : nsISupports { /** * Adds a new search engine from the file at the supplied URI, optionally - * asking the user for confirmation first. The confirmation dialog also - * offers the option to begin using the newly added engine right away. + * asking the user for confirmation first. If a confirmation dialog is + * shown, it will offer the option to begin using the newly added engine + * right away; if no confirmation dialog is shown, the new engine will be + * used right away automatically. * * @param engineURL * The URL to the search engine's description file. @@ -195,7 +197,8 @@ interface nsIBrowserSearchService : nsISupports in boolean confirm); /** - * Adds a new search engine, without asking the user for confirmation. + * Adds a new search engine, without asking the user for confirmation and + * without starting to use it right away. * * @param name * The search engine's name. Must be unique. Must not be null. diff --git a/browser/components/search/nsSearchService.js b/browser/components/search/nsSearchService.js index 885e21e85ce0..e31f25f0206e 100755 --- a/browser/components/search/nsSearchService.js +++ b/browser/components/search/nsSearchService.js @@ -983,7 +983,7 @@ Engine.prototype = { _confirm: false, // Whether to set this as the current engine as soon as it is loaded. This // is only used when the engine is first added to the list. - _useNow: false, + _useNow: true, // Whether the search engine file is in the app dir. __isInAppDir: null, // The number of days between update checks for new versions