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

Unified Diff: headless/lib/headless_content_main_delegate.cc

Issue 2829973002: add customized printing setting for headless (Closed)
Patch Set: nit change 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 067ef27193dd9feb922c84c636bb7d6393778e3e..2e92cabed45be1ff3839525443242d16925fae8e 100644
--- a/headless/lib/headless_content_main_delegate.cc
+++ b/headless/lib/headless_content_main_delegate.cc
@@ -33,6 +33,12 @@
#include "headless/embedded_resource_pak.h"
#endif
+#if defined(OS_MACOSX)
+#include "base/mac/bundle_locations.h"
+#else
+#include "ui/base/ui_base_paths.h"
+#endif
+
namespace headless {
namespace {
// Keep in sync with content/common/content_constants_internal.h.
@@ -241,6 +247,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.AppendASCII(FILE_PATH_LITERAL("headless_locales"));
Lei Zhang 2017/04/20 08:35:58 AppendASCII and FILE_PATH_LITERAL should never be
jzfeng 2017/04/27 06:56:07 Done. Headless chrome is about to be enabled on Wi
+#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