Chromium Code Reviews| Index: mojo/shell/mojo_url_resolver.cc |
| diff --git a/mojo/shell/mojo_url_resolver.cc b/mojo/shell/mojo_url_resolver.cc |
| index 883f5e47644242f22dcd11b00822587278dc3767..88e6215cc62134f4adbe4086b467c32b80fef05f 100644 |
| --- a/mojo/shell/mojo_url_resolver.cc |
| +++ b/mojo/shell/mojo_url_resolver.cc |
| @@ -30,11 +30,10 @@ GURL AddTrailingSlashIfNeeded(const GURL& url) { |
| MojoURLResolver::MojoURLResolver() { |
| // Needed to treat first component of mojo URLs as host, not path. |
| url::AddStandardScheme("mojo"); |
| - |
| - // By default, resolve mojo URLs to files living alongside the shell. |
| + // By default, apps bundled with the shell reside alongside the shell. |
|
qsr
2014/12/05 17:02:58
There is no bundle when we run mojo_shell in the o
ppi
2014/12/10 16:21:00
Fixed, ptal.
I changed it because I found it conf
|
| base::FilePath path; |
| PathService::Get(base::DIR_MODULE, &path); |
| - default_base_url_ = AddTrailingSlashIfNeeded(FilePathToFileURL(path)); |
| + local_apps_url_ = AddTrailingSlashIfNeeded(FilePathToFileURL(path)); |
| } |
| MojoURLResolver::~MojoURLResolver() { |
| @@ -47,6 +46,12 @@ void MojoURLResolver::SetBaseURL(const GURL& base_url) { |
| base_url_ = AddTrailingSlashIfNeeded(base_url); |
| } |
| +void MojoURLResolver::SetLocalAppsPath(const base::FilePath& local_apps_path) { |
| + local_apps_url_ = |
| + AddTrailingSlashIfNeeded(FilePathToFileURL(local_apps_path)); |
| + DCHECK(local_apps_url_.is_valid()); |
| +} |
| + |
| void MojoURLResolver::AddCustomMapping(const GURL& mojo_url, |
| const GURL& resolved_url) { |
| url_map_[mojo_url] = resolved_url; |
| @@ -68,7 +73,7 @@ GURL MojoURLResolver::Resolve(const GURL& mojo_url) const { |
| if (!base_url_.is_valid() || |
| local_file_set_.find(mapped_url) != local_file_set_.end()) { |
| // Resolve to a local file URL. |
| - return default_base_url_.Resolve(lib); |
| + return local_apps_url_.Resolve(lib); |
| } |
| // Otherwise, resolve to an URL relative to base_url_. |