Chromium Code Reviews| Index: chrome/browser/user_data_dir_extractor_win.cc |
| diff --git a/chrome/browser/user_data_dir_extractor_win.cc b/chrome/browser/user_data_dir_extractor_win.cc |
| index 5c4b94147f6e7f861874da86b248d27a0a7aa433..33b799258209338aa0f73311bd1f47dbf0bdf4e0 100644 |
| --- a/chrome/browser/user_data_dir_extractor_win.cc |
| +++ b/chrome/browser/user_data_dir_extractor_win.cc |
| @@ -14,6 +14,8 @@ |
| #include "chrome/common/chrome_paths.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "content/public/common/main_function_params.h" |
| +#include "ui/base/resource/resource_bundle.h" |
| +#include "ui/base/ui_base_switches.h" |
| namespace chrome { |
| @@ -21,6 +23,8 @@ namespace { |
| GetUserDataDirCallback* custom_get_user_data_dir_callback = NULL; |
| +const char kDefaultUserDataDirDialogLocale[] = "en-US"; |
| + |
| } // namespace |
| void InstallCustomGetUserDataDirCallbackForTest( |
| @@ -46,6 +50,17 @@ base::FilePath GetUserDataDir(const content::MainFunctionParams& parameters) { |
| // TODO(beng): |
| NOTIMPLEMENTED(); |
| #else |
| + // Make sure ResourceBundle is initialized. The user data dialog needs to |
| + // access string resources. See http://crbug.com/230432 |
| + if (!ResourceBundle::HasSharedInstance()) { |
| + // Check if a locale override has been specified on the command line. |
| + CommandLine command_line = parameters.command_line; |
| + std::string locale = command_line.GetSwitchValueASCII(switches::kLang); |
| + if (locale.empty()) |
| + locale = kDefaultUserDataDirDialogLocale; |
|
jungshik at Google
2013/04/11 21:57:55
Can we do better than this? Is this only for Windo
hshi1
2013/04/11 23:05:33
Can you review Patch Set #4? Thanks!
On 2013/04/1
|
| + ResourceBundle::InitSharedInstanceWithLocale(locale, NULL); |
| + } |
| + |
| base::FilePath new_user_data_dir = |
| chrome::ShowUserDataDirDialog(user_data_dir); |