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

Unified Diff: ui/base/resource/resource_bundle_posix.cc

Issue 7033022: Adding support for loading custom locale resources using a command line flag (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixing alignment Created 9 years, 7 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 | « base/base_switches.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/resource_bundle_posix.cc
diff --git a/ui/base/resource/resource_bundle_posix.cc b/ui/base/resource/resource_bundle_posix.cc
index d2fe55b66120168ddf510cb003f89a02b4b0d011..c62983a1cb0e6fa40704e5fbd2666320cf77da32 100644
--- a/ui/base/resource/resource_bundle_posix.cc
+++ b/ui/base/resource/resource_bundle_posix.cc
@@ -4,6 +4,9 @@
#include "ui/base/resource/resource_bundle.h"
+#include "base/base_switches.h"
+#include "base/command_line.h"
+#include "base/file_path.h"
#include "base/logging.h"
#include "base/stl_util-inl.h"
#include "base/string16.h"
@@ -112,7 +115,14 @@ std::string ResourceBundle::LoadLocaleResources(
const std::string& pref_locale) {
DCHECK(!locale_resources_data_) << "locale.pak already loaded";
std::string app_locale = l10n_util::GetApplicationLocale(pref_locale);
- FilePath locale_file_path = GetLocaleFilePath(app_locale);
+ FilePath locale_file_path;
+ CommandLine *command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kLocalePak)) {
+ locale_file_path =
+ command_line->GetSwitchValuePath(switches::kLocalePak);
+ } else {
+ locale_file_path = GetLocaleFilePath(app_locale);
+ }
if (locale_file_path.empty()) {
// It's possible that there is no locale.pak.
NOTREACHED();
« no previous file with comments | « base/base_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698