diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-10 00:04:48 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-10 00:04:48 +0000 |
commit | ce4b6a9dbb6ac14810294205185d385f066457fc (patch) | |
tree | 6c152e7d0e6ffc89b5c80eadbab5f24ec6ed7424 /app/resource_bundle.h | |
parent | a437e4c7a38a959f3412df30b9b066c5d869ccc4 (diff) | |
download | chromium_src-ce4b6a9dbb6ac14810294205185d385f066457fc.zip chromium_src-ce4b6a9dbb6ac14810294205185d385f066457fc.tar.gz chromium_src-ce4b6a9dbb6ac14810294205185d385f066457fc.tar.bz2 |
Make BrowserProcess::GetApplicationLocale thread safe and migrate
callers of l10n_util::GetApplicationLocale to use this instead.
In the browser process, it's wrong to call
l10n_util::GetApplicationLocale with an empty string because then
it won't consider the user pref value when resolving the locale.
On Linux, it's also wrong to call l10n_util::GetApplicationLocale
after startup because the call touches disk and on Linux, we assume
that all of the program files can be deleted after startup (so
updates in place can work).
Review URL: http://codereview.chromium.org/476002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34206 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/resource_bundle.h')
-rw-r--r-- | app/resource_bundle.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/resource_bundle.h b/app/resource_bundle.h index 550fb72..0273494 100644 --- a/app/resource_bundle.h +++ b/app/resource_bundle.h @@ -63,10 +63,11 @@ class ResourceBundle { LargeFont, }; - // Initialize the ResourceBundle for this process. + // Initialize the ResourceBundle for this process. Returns the language + // selected. // NOTE: Mac ignores this and always loads up resources for the language // defined by the Cocoa UI (ie-NSBundle does the langange work). - static void InitSharedInstance(const std::wstring& pref_locale); + static std::string InitSharedInstance(const std::wstring& pref_locale); // Delete the ResourceBundle for this process if it exists. static void CleanupSharedInstance(); @@ -169,8 +170,8 @@ class ResourceBundle { #endif // Try to load the main resources and the locale specific strings from an - // external data module. - void LoadResources(const std::wstring& pref_locale); + // external data module. Returns the locale that is loaded. + std::string LoadResources(const std::wstring& pref_locale); // Initialize all the gfx::Font members if they haven't yet been initialized. void LoadFontsIfNecessary(); @@ -183,7 +184,7 @@ class ResourceBundle { // Returns the full pathname of the locale file to load. May return an empty // string if no locale data files are found. - static FilePath GetLocaleFilePath(const std::wstring& pref_locale); + static FilePath GetLocaleFilePath(const std::string& app_locale); // Returns a handle to bytes from the resource |module|, without doing any // processing or interpretation of the resource. Returns whether we |