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

Unified Diff: shell/context.h

Issue 873253003: Resolve URLs passed on the command line relative to the CWD. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase Created 5 years, 11 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 | « shell/command_line_util_unittest.cc ('k') | shell/context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/context.h
diff --git a/shell/context.h b/shell/context.h
index 85d1d67f1748cc7ef888547eb5771219f595d0c2..d672e1ac1bf395c1f09df396b7fee1c39ba88796 100644
--- a/shell/context.h
+++ b/shell/context.h
@@ -35,6 +35,14 @@ class Context : ApplicationManager::Delegate {
// everything but relative file URLs or URLs without a scheme.
GURL ResolveShellFileURL(const std::string& path);
+ // Override the CWD, which is used for resolving file URLs passed in from the
+ // command line.
+ void SetCommandLineCWD(const base::FilePath& path);
+
+ // Resolve an URL relative to the CWD mojo_shell was invoked from. This is a
+ // nop for everything but relative file URLs or URLs without a scheme.
+ GURL ResolveCommandLineURL(const std::string& path);
+
static void EnsureEmbedderIsInitialized();
bool Init();
@@ -61,6 +69,7 @@ class Context : ApplicationManager::Delegate {
ApplicationManager application_manager_;
MojoURLResolver mojo_url_resolver_;
GURL shell_file_root_;
+ GURL command_line_cwd_;
DISALLOW_COPY_AND_ASSIGN(Context);
};
« no previous file with comments | « shell/command_line_util_unittest.cc ('k') | shell/context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698