| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 MOJO_SHELL_SHELL_APPLICATION_DELEGATE_H_ | 5 #ifndef MOJO_SHELL_SHELL_APPLICATION_DELEGATE_H_ |
| 6 #define MOJO_SHELL_SHELL_APPLICATION_DELEGATE_H_ | 6 #define MOJO_SHELL_SHELL_APPLICATION_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "mojo/shell/public/cpp/application_delegate.h" | |
| 9 | |
| 10 #include <stdint.h> | 8 #include <stdint.h> |
| 11 | 9 |
| 12 #include "base/macros.h" | 10 #include "base/macros.h" |
| 13 #include "mojo/common/weak_binding_set.h" | 11 #include "mojo/common/weak_binding_set.h" |
| 14 #include "mojo/shell/public/cpp/interface_factory.h" | 12 #include "mojo/shell/public/cpp/interface_factory.h" |
| 13 #include "mojo/shell/public/cpp/shell_client.h" |
| 15 #include "mojo/shell/public/interfaces/application_manager.mojom.h" | 14 #include "mojo/shell/public/interfaces/application_manager.mojom.h" |
| 16 | 15 |
| 17 namespace mojo { | 16 namespace mojo { |
| 18 namespace shell { | 17 namespace shell { |
| 19 class ApplicationManager; | 18 class ApplicationManager; |
| 20 | 19 |
| 21 class ShellApplicationDelegate | 20 class ShellApplicationDelegate |
| 22 : public ApplicationDelegate, | 21 : public ShellClient, |
| 23 public InterfaceFactory<mojom::ApplicationManager>, | 22 public InterfaceFactory<mojom::ApplicationManager>, |
| 24 public mojom::ApplicationManager { | 23 public mojom::ApplicationManager { |
| 25 public: | 24 public: |
| 26 explicit ShellApplicationDelegate(mojo::shell::ApplicationManager* manager); | 25 explicit ShellApplicationDelegate(mojo::shell::ApplicationManager* manager); |
| 27 ~ShellApplicationDelegate() override; | 26 ~ShellApplicationDelegate() override; |
| 28 | 27 |
| 29 private: | 28 private: |
| 30 // Overridden from ApplicationDelegate: | 29 // Overridden from ShellClient: |
| 31 void Initialize(Shell* shell, const std::string& url, uint32_t id) override; | 30 void Initialize(Shell* shell, const std::string& url, uint32_t id) override; |
| 32 bool AcceptConnection(ApplicationConnection* connection) override; | 31 bool AcceptConnection(Connection* connection) override; |
| 33 | 32 |
| 34 // Overridden from InterfaceFactory<mojom::ApplicationManager>: | 33 // Overridden from InterfaceFactory<mojom::ApplicationManager>: |
| 35 void Create( | 34 void Create( |
| 36 ApplicationConnection* connection, | 35 Connection* connection, |
| 37 InterfaceRequest<mojom::ApplicationManager> request) override; | 36 InterfaceRequest<mojom::ApplicationManager> request) override; |
| 38 | 37 |
| 39 // Overridden from mojom::ApplicationManager: | 38 // Overridden from mojom::ApplicationManager: |
| 40 void CreateInstanceForHandle( | 39 void CreateInstanceForHandle( |
| 41 ScopedHandle channel, | 40 ScopedHandle channel, |
| 42 const String& url, | 41 const String& url, |
| 43 mojom::CapabilityFilterPtr filter, | 42 mojom::CapabilityFilterPtr filter, |
| 44 InterfaceRequest<mojom::PIDReceiver> pid_receiver) override; | 43 InterfaceRequest<mojom::PIDReceiver> pid_receiver) override; |
| 45 void AddListener( | 44 void AddListener( |
| 46 mojom::ApplicationManagerListenerPtr listener) override; | 45 mojom::ApplicationManagerListenerPtr listener) override; |
| 47 | 46 |
| 48 mojo::shell::ApplicationManager* manager_; | 47 mojo::shell::ApplicationManager* manager_; |
| 49 | 48 |
| 50 WeakBindingSet<mojom::ApplicationManager> bindings_; | 49 WeakBindingSet<mojom::ApplicationManager> bindings_; |
| 51 | 50 |
| 52 DISALLOW_COPY_AND_ASSIGN(ShellApplicationDelegate); | 51 DISALLOW_COPY_AND_ASSIGN(ShellApplicationDelegate); |
| 53 }; | 52 }; |
| 54 | 53 |
| 55 } // namespace shell | 54 } // namespace shell |
| 56 } // namespace mojo | 55 } // namespace mojo |
| 57 | 56 |
| 58 #endif // MOJO_SHELL_SHELL_APPLICATION_DELEGATE_H_ | 57 #endif // MOJO_SHELL_SHELL_APPLICATION_DELEGATE_H_ |
| OLD | NEW |