summaryrefslogtreecommitdiffstats
path: root/chrome_frame/simple_resource_loader.h
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-24 14:29:44 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-24 14:29:44 +0000
commite14fff7f803688dea1aea0c96fae7fe1c507dd4d (patch)
treece73556c134671cb2e1e10adcb41697c181d721c /chrome_frame/simple_resource_loader.h
parentfc98920033d04a91f943dcfef032846072cdd4dc (diff)
downloadchromium_src-e14fff7f803688dea1aea0c96fae7fe1c507dd4d.zip
chromium_src-e14fff7f803688dea1aea0c96fae7fe1c507dd4d.tar.gz
chromium_src-e14fff7f803688dea1aea0c96fae7fe1c507dd4d.tar.bz2
Correct problem with localized resource loading in Chrome Frame: we were not loading language DLLs that did not have a region specifier.
BUG=56432 TEST=Chrome Frame loads correctly in non-region specific languages, e.g. French. Review URL: http://codereview.chromium.org/3439020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60465 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/simple_resource_loader.h')
-rw-r--r--chrome_frame/simple_resource_loader.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/chrome_frame/simple_resource_loader.h b/chrome_frame/simple_resource_loader.h
index 95e4425..45aca746 100644
--- a/chrome_frame/simple_resource_loader.h
+++ b/chrome_frame/simple_resource_loader.h
@@ -13,6 +13,8 @@
#include <windows.h>
#include <string>
+#include "base/file_path.h"
+#include "base/gtest_prod_util.h"
#include "base/singleton.h"
class SimpleResourceLoader {
@@ -32,20 +34,23 @@ class SimpleResourceLoader {
private:
SimpleResourceLoader();
+ ~SimpleResourceLoader();
- // Retrieves the system locale in the <language>-<region> format using ICU.
- std::wstring GetSystemLocale();
+ // Retrieves the system language and the region using ICU.
+ void GetSystemLocale(std::wstring* language, std::wstring* region);
// Uses |locale| to build the resource DLL name and then looks for the named
// DLL in known locales paths. If it doesn't find it, it falls back to
// looking for an en-US.dll.
//
// Returns true if a locale DLL can be found, false otherwise.
- bool GetLocaleFilePath(const std::wstring& locale, std::wstring* file_path);
+ bool GetLocaleFilePath(const std::wstring& language,
+ const std::wstring& region,
+ FilePath* file_path);
// Loads the locale dll at the given path. Returns a handle to the DLL or
// NULL on failure.
- HINSTANCE LoadLocaleDll(const std::wstring& dll_path);
+ HINSTANCE LoadLocaleDll(const FilePath& dll_path);
// Returns the string resource identified by message_id from the currently
// loaded locale dll.
@@ -53,6 +58,8 @@ class SimpleResourceLoader {
friend struct DefaultSingletonTraits<SimpleResourceLoader>;
+ FRIEND_TEST_ALL_PREFIXES(SimpleResourceLoaderTest, GetLocaleFilePath);
+
static HINSTANCE locale_dll_handle_;
};