Bug 826996 - Avoid hardcoded value for {moz:official} in search plugins. r=gavin

--HG--
extra : rebase_source : fe2a5b7c6efed6ff7f4b786a0ce510fc28a25ef9
This commit is contained in:
Mike Hommey 2013-01-11 12:20:58 +01:00
Родитель 764ebaf77e
Коммит 032a047cc1
4 изменённых файлов: 24 добавлений и 1 удалений

Просмотреть файл

@ -368,6 +368,11 @@ pref("browser.search.update.interval", 21600);
// enable search suggestions by default // enable search suggestions by default
pref("browser.search.suggest.enabled", true); pref("browser.search.suggest.enabled", true);
#ifdef MOZ_OFFICIAL_BRANDING
// {moz:official} expands to "official"
pref("browser.search.official", true);
#endif
pref("browser.sessionhistory.max_entries", 50); pref("browser.sessionhistory.max_entries", 50);
// handle links targeting new windows // handle links targeting new windows

Просмотреть файл

@ -262,6 +262,11 @@ pref("browser.search.jarURIs", "chrome://browser/locale/searchplugins/");
// tell the search service that we don't really expose the "current engine" // tell the search service that we don't really expose the "current engine"
pref("browser.search.noCurrentEngine", true); pref("browser.search.noCurrentEngine", true);
#ifdef MOZ_OFFICIAL_BRANDING
// {moz:official} expands to "official"
pref("browser.search.official", true);
#endif
// enable xul error pages // enable xul error pages
pref("browser.xul.error_pages.enabled", true); pref("browser.xul.error_pages.enabled", true);

Просмотреть файл

@ -256,6 +256,11 @@ pref("browser.search.jarURIs", "chrome://browser/locale/searchplugins/");
// tell the search service that we don't really expose the "current engine" // tell the search service that we don't really expose the "current engine"
pref("browser.search.noCurrentEngine", true); pref("browser.search.noCurrentEngine", true);
#ifdef MOZ_OFFICIAL_BRANDING
// {moz:official} expands to "official"
pref("browser.search.official", true);
#endif
// enable xul error pages // enable xul error pages
pref("browser.xul.error_pages.enabled", true); pref("browser.xul.error_pages.enabled", true);

Просмотреть файл

@ -803,13 +803,21 @@ function ParamSubstitution(aParamValue, aSearchTerms, aEngine) {
distributionID = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + "distributionID"); distributionID = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + "distributionID");
} }
catch (ex) { } catch (ex) { }
var official = MOZ_OFFICIAL;
try {
if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "official"))
official = "official";
else
official = "unofficial";
}
catch (ex) { }
// Custom search parameters. These are only available to default search // Custom search parameters. These are only available to default search
// engines. // engines.
if (aEngine._isDefault) { if (aEngine._isDefault) {
value = value.replace(MOZ_PARAM_LOCALE, getLocale()); value = value.replace(MOZ_PARAM_LOCALE, getLocale());
value = value.replace(MOZ_PARAM_DIST_ID, distributionID); value = value.replace(MOZ_PARAM_DIST_ID, distributionID);
value = value.replace(MOZ_PARAM_OFFICIAL, MOZ_OFFICIAL); value = value.replace(MOZ_PARAM_OFFICIAL, official);
} }
// Insert the OpenSearch parameters we're confident about // Insert the OpenSearch parameters we're confident about