| 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 44ee7094566e4a67bf77d093a94513c89a393364..00b34fbdb7141e1d7906e0a36b8290382ee77d1d 100644
|
| --- a/headless/lib/headless_content_main_delegate.cc
|
| +++ b/headless/lib/headless_content_main_delegate.cc
|
| @@ -5,6 +5,7 @@
|
| #include "headless/lib/headless_content_main_delegate.h"
|
|
|
| #include "base/command_line.h"
|
| +#include "base/files/file_util.h"
|
| #include "base/path_service.h"
|
| #include "base/run_loop.h"
|
| #include "base/trace_event/trace_event.h"
|
| @@ -109,10 +110,17 @@ HeadlessContentMainDelegate* HeadlessContentMainDelegate::GetInstance() {
|
|
|
| // static
|
| void HeadlessContentMainDelegate::InitializeResourceBundle() {
|
| + base::FilePath dir_module;
|
| base::FilePath pak_file;
|
| - bool result = PathService::Get(base::DIR_MODULE, &pak_file);
|
| + bool result = PathService::Get(base::DIR_MODULE, &dir_module);
|
| DCHECK(result);
|
| - pak_file = pak_file.Append(FILE_PATH_LITERAL("headless_lib.pak"));
|
| + // 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"));
|
| + // TODO(skyostil): Use the locale-based loader instead.
|
| ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file);
|
| }
|
|
|
|
|