OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MOJO_SHELL_FETCHER_URL_RESOLVER_H_ | |
6 #define MOJO_SHELL_FETCHER_URL_RESOLVER_H_ | |
7 | |
8 #include <map> | |
9 #include <set> | |
10 | |
11 #include "base/command_line.h" | |
12 #include "base/files/file_path.h" | |
13 #include "base/macros.h" | |
14 #include "url/gurl.h" | |
15 | |
16 namespace mojo { | |
17 namespace shell { | |
18 | |
19 // Supports resolving "mojo:" URLs to a file location, with ".mojo" appended. | |
20 class URLResolver { | |
21 public: | |
22 explicit URLResolver(const GURL& mojo_base_url); | |
23 ~URLResolver(); | |
24 | |
25 // Resolve the given "mojo:" URL to the URL that should be used to fetch the | |
26 // code for the corresponding Mojo App. | |
27 GURL ResolveMojoURL(const GURL& mojo_url) const; | |
28 // Resolve the given "mojo:" URL to the URL that should be used to fetch the | |
29 // application manifest for the corresponding Mojo App. Returns an empty url | |
30 // if no manifest can be resolved (e.g. for non-Mojo application URLs). | |
31 GURL ResolveMojoManifest(const GURL& mojo_url) const; | |
32 | |
33 private: | |
34 GURL mojo_base_url_; | |
35 | |
36 DISALLOW_COPY_AND_ASSIGN(URLResolver); | |
37 }; | |
38 | |
39 } // namespace shell | |
40 } // namespace mojo | |
41 | |
42 #endif // MOJO_SHELL_FETCHER_URL_RESOLVER_H_ | |
OLD | NEW |