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 17 matching lines...) Expand all Loading... |
28 | 28 |
29 namespace shell { | 29 namespace shell { |
30 | 30 |
31 class Fetcher; | 31 class Fetcher; |
32 class ShellImpl; | 32 class ShellImpl; |
33 | 33 |
34 class ApplicationManager { | 34 class ApplicationManager { |
35 public: | 35 public: |
36 class Delegate { | 36 class Delegate { |
37 public: | 37 public: |
38 virtual ~Delegate(); | 38 // Gives the delegate a chance to apply any mappings for the specified url. |
39 virtual GURL ResolveURL(const GURL& url); | 39 // This should not resolve 'mojo' urls, that is done by ResolveMojoURL(). |
40 virtual GURL ResolveMappings(const GURL& url); | 40 virtual GURL ResolveMappings(const GURL& url) = 0; |
| 41 |
| 42 // Used to map a url with the scheme 'mojo' to the appropriate url. Return |
| 43 // |url| if the scheme is not 'mojo'. |
| 44 virtual GURL ResolveMojoURL(const GURL& url) = 0; |
| 45 |
| 46 protected: |
| 47 virtual ~Delegate() {} |
41 }; | 48 }; |
42 | 49 |
43 // API for testing. | 50 // API for testing. |
44 class TestAPI { | 51 class TestAPI { |
45 public: | 52 public: |
46 explicit TestAPI(ApplicationManager* manager); | 53 explicit TestAPI(ApplicationManager* manager); |
47 ~TestAPI(); | 54 ~TestAPI(); |
48 | 55 |
49 // Returns true if the shared instance has been created. | 56 // Returns true if the shared instance has been created. |
50 static bool HasCreatedInstance(); | 57 static bool HasCreatedInstance(); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 ScopedVector<NativeRunner> native_runners_; | 236 ScopedVector<NativeRunner> native_runners_; |
230 bool disable_cache_; | 237 bool disable_cache_; |
231 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; | 238 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; |
232 | 239 |
233 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); | 240 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); |
234 }; | 241 }; |
235 | 242 |
236 } // namespace shell | 243 } // namespace shell |
237 | 244 |
238 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 245 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ |
OLD | NEW |