Bug 1043627 - Only re-initialize nsSearchService on locale change in Fennec. r=adw

This commit is contained in:
Richard Newman 2014-07-25 11:34:23 -07:00
Родитель 84820a3293
Коммит bce02b3a15
2 изменённых файлов: 11 добавлений и 0 удалений

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

@ -16,3 +16,6 @@ EXTRA_PP_COMPONENTS += [
]
DEFINES['MOZ_DISTRIBUTION_ID'] = CONFIG['MOZ_DISTRIBUTION_ID']
if CONFIG['MOZ_BUILD_APP'] == 'mobile/android':
DEFINES['MOZ_FENNEC'] = True

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

@ -4171,12 +4171,14 @@ SearchService.prototype = {
break;
case "nsPref:changed":
#ifdef MOZ_FENNEC
if (aVerb == LOCALE_PREF) {
// Locale changed. Re-init. We rely on observers, because we can't
// return this promise to anyone.
this._asyncReInit();
break;
}
#endif
let currPref = BROWSER_SEARCH_PREF + "selectedEngine";
if (aVerb == currPref && !this._changingCurrentEngine) {
@ -4236,7 +4238,10 @@ SearchService.prototype = {
Services.obs.addObserver(this, QUIT_APPLICATION_TOPIC, false);
Services.prefs.addObserver(BROWSER_SEARCH_PREF + "defaultenginename", this, false);
Services.prefs.addObserver(BROWSER_SEARCH_PREF + "selectedEngine", this, false);
#ifdef MOZ_FENNEC
Services.prefs.addObserver(LOCALE_PREF, this, false);
#endif
// The current stage of shutdown. Used to help analyze crash
// signatures in case of shutdown timeout.
@ -4284,7 +4289,10 @@ SearchService.prototype = {
Services.obs.removeObserver(this, QUIT_APPLICATION_TOPIC);
Services.prefs.removeObserver(BROWSER_SEARCH_PREF + "defaultenginename", this);
Services.prefs.removeObserver(BROWSER_SEARCH_PREF + "selectedEngine", this);
#ifdef MOZ_FENNEC
Services.prefs.removeObserver(LOCALE_PREF, this);
#endif
},
QueryInterface: function SRCH_SVC_QI(aIID) {