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

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 Jeremy's comments 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
« chrome/common/chrome_switches.cc ('K') | « chrome/common/chrome_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..b6668b855951cb4154d17e740e55f25923519f90 100644
--- a/ui/base/resource/resource_bundle_posix.cc
+++ b/ui/base/resource/resource_bundle_posix.cc
@@ -4,11 +4,14 @@
#include "ui/base/resource/resource_bundle.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"
#include "base/string_piece.h"
#include "base/synchronization/lock.h"
+#include "chrome/common/chrome_switches.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/data_pack.h"
#include "ui/gfx/font.h"
@@ -112,7 +115,15 @@ 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::kForceLocaleResourcesPathSwitch)) {
+ locale_file_path =
+ command_line->GetSwitchValuePath(
+ switches::kForceLocaleResourcesPathSwitch);
+ } else {
+ locale_file_path = GetLocaleFilePath(app_locale);
+ }
if (locale_file_path.empty()) {
// It's possible that there is no locale.pak.
NOTREACHED();
« chrome/common/chrome_switches.cc ('K') | « chrome/common/chrome_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698