зеркало из https://github.com/mozilla/gecko-dev.git
Bug 653141 - Changing locales should be instant. r=bsmedberg
This commit is contained in:
Родитель
c78a0ad45c
Коммит
179177d1fa
|
@ -116,7 +116,7 @@ protected:
|
|||
|
||||
// Update the selected locale used by the chrome registry, and fire a
|
||||
// notification about this change
|
||||
virtual void UpdateSelectedLocale() = 0;
|
||||
virtual nsresult UpdateSelectedLocale() = 0;
|
||||
|
||||
static void LogMessage(const char* aMsg, ...);
|
||||
static void LogMessageWithContext(nsIURI* aURL, PRUint32 aLineNumber, PRUint32 flags,
|
||||
|
|
|
@ -368,12 +368,9 @@ nsChromeRegistryChrome::Observe(nsISupports *aSubject, const char *aTopic,
|
|||
|
||||
if (pref.EqualsLiteral(MATCH_OS_LOCALE_PREF) ||
|
||||
pref.EqualsLiteral(SELECTED_LOCALE_PREF)) {
|
||||
if (!mProfileLoaded) {
|
||||
rv = SelectLocaleFromPref(prefs);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
}
|
||||
FlushAllCaches();
|
||||
rv = UpdateSelectedLocale();
|
||||
if (NS_SUCCEEDED(rv) && mProfileLoaded)
|
||||
FlushAllCaches();
|
||||
}
|
||||
else if (pref.EqualsLiteral(SELECTED_SKIN_PREF)) {
|
||||
nsXPIDLCString provider;
|
||||
|
@ -426,11 +423,12 @@ nsChromeRegistryChrome::CheckForNewChrome()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsChromeRegistryChrome::UpdateSelectedLocale()
|
||||
nsresult nsChromeRegistryChrome::UpdateSelectedLocale()
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
|
||||
if (prefs) {
|
||||
nsresult rv = SelectLocaleFromPref(prefs);
|
||||
rv = SelectLocaleFromPref(prefs);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIObserverService> obsSvc =
|
||||
mozilla::services::GetObserverService();
|
||||
|
@ -439,6 +437,8 @@ void nsChromeRegistryChrome::UpdateSelectedLocale()
|
|||
"selected-locale-has-changed", nsnull);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -83,7 +83,7 @@ class nsChromeRegistryChrome : public nsChromeRegistry
|
|||
PRUint32 number, void *arg);
|
||||
|
||||
nsresult SelectLocaleFromPref(nsIPrefBranch* prefs);
|
||||
NS_OVERRIDE void UpdateSelectedLocale();
|
||||
NS_OVERRIDE nsresult UpdateSelectedLocale();
|
||||
NS_OVERRIDE nsIURI* GetBaseURIFromPackage(const nsCString& aPackage,
|
||||
const nsCString& aProvider,
|
||||
const nsCString& aPath);
|
||||
|
|
|
@ -278,9 +278,9 @@ nsChromeRegistryContent::GetXULOverlays(nsIURI *aChromeURL,
|
|||
CONTENT_NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
void nsChromeRegistryContent::UpdateSelectedLocale()
|
||||
nsresult nsChromeRegistryContent::UpdateSelectedLocale()
|
||||
{
|
||||
CONTENT_NOTREACHED();
|
||||
CONTENT_NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -89,7 +89,7 @@ class nsChromeRegistryContent : public nsChromeRegistry
|
|||
void RegisterResource(const ResourceMapping& aResource);
|
||||
void RegisterOverride(const OverrideMapping& aOverride);
|
||||
|
||||
NS_OVERRIDE void UpdateSelectedLocale();
|
||||
NS_OVERRIDE nsresult UpdateSelectedLocale();
|
||||
NS_OVERRIDE nsIURI* GetBaseURIFromPackage(const nsCString& aPackage,
|
||||
const nsCString& aProvider,
|
||||
const nsCString& aPath);
|
||||
|
|
Загрузка…
Ссылка в новой задаче