Index: shell/context.cc |
diff --git a/shell/context.cc b/shell/context.cc |
index 623bb60d03b9c7f9354d660313b6d415f42c3d29..4baac09964b8c0f019769b27295e35efe7f169bb 100644 |
--- a/shell/context.cc |
+++ b/shell/context.cc |
@@ -137,7 +137,7 @@ bool ConfigureURLMappings(base::CommandLine* command_line, |
using StringPair = std::pair<std::string, std::string>; |
for (const StringPair& pair : pairs) { |
const GURL from(pair.first); |
- const GURL to(pair.second); |
+ const GURL to = context->ResolveCommandLineURL(pair.second); |
if (!from.is_valid() || !to.is_valid()) |
return false; |
resolver->AddCustomMapping(from, to); |
@@ -157,6 +157,10 @@ Context::Context() : application_manager_(this) { |
base::FilePath shell_dir; |
PathService::Get(base::DIR_MODULE, &shell_dir); |
SetShellFileRoot(shell_dir); |
+ |
+ base::FilePath cwd; |
+ PathService::Get(base::DIR_CURRENT, &cwd); |
+ SetCommandLineCWD(cwd); |
} |
Context::~Context() { |
@@ -175,6 +179,14 @@ GURL Context::ResolveShellFileURL(const std::string& path) { |
return shell_file_root_.Resolve(path); |
} |
+void Context::SetCommandLineCWD(const base::FilePath& path) { |
+ command_line_cwd_ = AddTrailingSlashIfNeeded(FilePathToFileURL(path)); |
+} |
+ |
+GURL Context::ResolveCommandLineURL(const std::string& path) { |
+ return command_line_cwd_.Resolve(path); |
+} |
+ |
bool Context::Init() { |
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |