| 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_LOADER_H_ | 5 #ifndef SHELL_APPLICATION_MANAGER_APPLICATION_LOADER_H_ |
| 6 #define SHELL_APPLICATION_MANAGER_APPLICATION_LOADER_H_ | 6 #define SHELL_APPLICATION_MANAGER_APPLICATION_LOADER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "mojo/public/cpp/system/core.h" | 9 #include "mojo/public/cpp/system/core.h" |
| 10 #include "mojo/public/interfaces/application/shell.mojom.h" |
| 10 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" | 11 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" |
| 11 #include "shell/application_manager/application_manager_export.h" | 12 #include "shell/application_manager/application_manager_export.h" |
| 12 #include "url/gurl.h" | 13 #include "url/gurl.h" |
| 13 | 14 |
| 14 namespace mojo { | 15 namespace mojo { |
| 15 | 16 |
| 16 class ApplicationManager; | 17 class ApplicationManager; |
| 17 | 18 |
| 18 // Interface to allowing loading behavior to be established for schemes, | 19 // Interface to allowing loading behavior to be established for schemes, |
| 19 // specific urls or as the default. | 20 // specific urls or as the default. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 35 // | 36 // |
| 36 // 1. |url| can refer directly to a Mojo application. In this case, | 37 // 1. |url| can refer directly to a Mojo application. In this case, |
| 37 // shell_handle should be used to implement the mojo.Application interface. | 38 // shell_handle should be used to implement the mojo.Application interface. |
| 38 // | 39 // |
| 39 // 2. |url| can refer to some content that can be handled by some other Mojo | 40 // 2. |url| can refer to some content that can be handled by some other Mojo |
| 40 // application. In this case, call callbacks and specify the URL of the | 41 // application. In this case, call callbacks and specify the URL of the |
| 41 // application that should handle the content. The specified application | 42 // application that should handle the content. The specified application |
| 42 // must implement the mojo.ContentHandler interface. | 43 // must implement the mojo.ContentHandler interface. |
| 43 virtual void Load(ApplicationManager* application_manager, | 44 virtual void Load(ApplicationManager* application_manager, |
| 44 const GURL& url, | 45 const GURL& url, |
| 45 ScopedMessagePipeHandle shell_handle, | 46 ShellPtr shell, |
| 46 LoadCallback callback) = 0; | 47 LoadCallback callback) = 0; |
| 47 | 48 |
| 48 // Called when the Application exits. | 49 // Called when the Application exits. |
| 49 virtual void OnApplicationError(ApplicationManager* manager, | 50 virtual void OnApplicationError(ApplicationManager* manager, |
| 50 const GURL& url) = 0; | 51 const GURL& url) = 0; |
| 51 | 52 |
| 52 protected: | 53 protected: |
| 53 ApplicationLoader() {} | 54 ApplicationLoader() {} |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 } // namespace mojo | 57 } // namespace mojo |
| 57 | 58 |
| 58 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_LOADER_H_ | 59 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_LOADER_H_ |
| OLD | NEW |