OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 5 #ifndef SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ |
6 #define SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 6 #define SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 namespace mojo { | 29 namespace mojo { |
30 namespace shell { | 30 namespace shell { |
31 | 31 |
32 class Fetcher; | 32 class Fetcher; |
33 class ShellImpl; | 33 class ShellImpl; |
34 | 34 |
35 class ApplicationManager { | 35 class ApplicationManager { |
36 public: | 36 public: |
37 class Delegate { | 37 class Delegate { |
38 public: | 38 public: |
39 virtual ~Delegate(); | 39 // Gives the delegate a chance to apply any mappings for the specified url. |
40 virtual GURL ResolveURL(const GURL& url); | 40 // This should not resolve 'mojo' urls, that is done by ResolveMojoURL(). |
41 virtual GURL ResolveMappings(const GURL& url); | 41 virtual GURL ResolveMappings(const GURL& url) = 0; |
| 42 |
| 43 // Used to map a url with the scheme 'mojo' to the appropriate url. Return |
| 44 // |url| if the scheme is not 'mojo'. |
| 45 virtual GURL ResolveMojoURL(const GURL& url) = 0; |
| 46 |
| 47 protected: |
| 48 virtual ~Delegate() {} |
42 }; | 49 }; |
43 | 50 |
44 // API for testing. | 51 // API for testing. |
45 class TestAPI { | 52 class TestAPI { |
46 public: | 53 public: |
47 explicit TestAPI(ApplicationManager* manager); | 54 explicit TestAPI(ApplicationManager* manager); |
48 ~TestAPI(); | 55 ~TestAPI(); |
49 | 56 |
50 // Returns true if the shared instance has been created. | 57 // Returns true if the shared instance has been created. |
51 static bool HasCreatedInstance(); | 58 static bool HasCreatedInstance(); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 bool disable_cache_; | 223 bool disable_cache_; |
217 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; | 224 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; |
218 | 225 |
219 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); | 226 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); |
220 }; | 227 }; |
221 | 228 |
222 } // namespace shell | 229 } // namespace shell |
223 } // namespace mojo | 230 } // namespace mojo |
224 | 231 |
225 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 232 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ |
OLD | NEW |