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

Unified Diff: headless/lib/headless_content_main_delegate.cc

Issue 2792913002: Add check for fallback on resources folder, in case that it was already found (e.g. in browsertests… (Closed)
Patch Set: Created 3 years, 9 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: 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 561f14be35cfa75812c88ee6cc6c9c45f652ab62..367d74ccd314c500bd29c55fe269b7b593eadb4d 100644
--- a/headless/lib/headless_content_main_delegate.cc
+++ b/headless/lib/headless_content_main_delegate.cc
@@ -250,15 +250,18 @@ void HeadlessContentMainDelegate::InitializeResourceBundle() {
kHeadlessResourcePak.length),
ui::SCALE_FACTOR_NONE);
#else
-#if defined(OS_MACOSX) && !defined(COMPONENT_BUILD)
- dir_module = dir_module.Append(FILE_PATH_LITERAL("Resources/"));
-#endif
// Try loading the headless library pak file first. If it doesn't exist (i.e.,
// when we're running with the --headless switch), fall back to the browser's
// resource pak.
pak_file = dir_module.Append(FILE_PATH_LITERAL("headless_lib.pak"));
if (!base::PathExists(pak_file))
pak_file = dir_module.Append(FILE_PATH_LITERAL("resources.pak"));
+#if defined(OS_MACOSX) && !defined(COMPONENT_BUILD)
+ // In non component builds, check if fall back in Resources/ folder is
+ // available.
+ if (!base::PathExists(pak_file))
+ pak_file = dir_module.Append(FILE_PATH_LITERAL("Resources/resources.pak"));
+#endif
ResourceBundle::GetSharedInstance().AddDataPackFromPath(
pak_file, ui::SCALE_FACTOR_NONE);
#endif
« 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