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

Unified Diff: headless/lib/headless_content_main_delegate.cc

Issue 2829973002: add customized printing setting for headless (Closed)
Patch Set: adjust command interface and add unit tests Created 3 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
Index: headless/lib/headless_content_main_delegate.cc
diff --git a/headless/lib/headless_content_main_delegate.cc b/headless/lib/headless_content_main_delegate.cc
index 9428908a6657555fd751c6f28ff32fdd3554a188..0139f8225355f3916add506c25acacfb4100870b 100644
--- a/headless/lib/headless_content_main_delegate.cc
+++ b/headless/lib/headless_content_main_delegate.cc
@@ -34,6 +34,12 @@
#endif
#if defined(OS_MACOSX)
+#include "base/mac/bundle_locations.h"
+#else
+#include "ui/base/ui_base_paths.h"
+#endif
+
+#if defined(OS_MACOSX)
#include "components/crash/content/app/crashpad.h"
#endif
@@ -244,6 +250,15 @@ void HeadlessContentMainDelegate::InitializeResourceBundle() {
bool result = PathService::Get(base::DIR_MODULE, &dir_module);
DCHECK(result);
+ // Override locale pak dir to 'headless_locales'.
+ base::FilePath locale_pak =
+ dir_module.Append(FILE_PATH_LITERAL("headless_locales"));
+#if defined(OS_MACOSX)
+ base::mac::SetOverrideFrameworkBundlePath(locale_pak);
+#else
+ PathService::Override(ui::DIR_LOCALES, locale_pak);
+#endif
+
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
const std::string locale = command_line->GetSwitchValueASCII(switches::kLang);
ui::ResourceBundle::InitSharedInstanceWithLocale(

Powered by Google App Engine
This is Rietveld 408576698