diff options
Diffstat (limited to 'chrome_frame/simple_resource_loader.h')
-rw-r--r-- | chrome_frame/simple_resource_loader.h | 15 |
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_; }; |