Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2407)

Unified Diff: chrome/browser/user_data_dir_extractor_win.cc

Issue 13825003: Fix uninintialized ResourceBundle in ShowUserDataDirDialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use l10n_util::GetApplicationLocale instead of cmdline switches. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..793991ae68780f38bf206175226a87cfdad75323 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/l10n/l10n_util.h"
+#include "ui/base/resource/resource_bundle.h"
namespace chrome {
@@ -21,6 +23,8 @@ namespace {
GetUserDataDirCallback* custom_get_user_data_dir_callback = NULL;
+const char kUserDataDirDialogFallbackLocale[] = "en-US";
+
} // namespace
void InstallCustomGetUserDataDirCallbackForTest(
@@ -46,6 +50,16 @@ 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()) {
+ std::string locale = l10n_util::GetApplicationLocale(std::string());
+ DCHECK(!locale.empty());
+ if (locale.empty())
+ locale = kUserDataDirDialogFallbackLocale;
+ ResourceBundle::InitSharedInstanceWithLocale(locale, NULL);
+ }
+
base::FilePath new_user_data_dir =
chrome::ShowUserDataDirDialog(user_data_dir);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698