| 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/application/public/cpp/application_delegate.h" | 8 #include "mojo/application/public/cpp/application_delegate.h" |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "mojo/application/public/cpp/interface_factory.h" | 11 #include "mojo/application/public/cpp/interface_factory.h" |
| 12 #include "mojo/application/public/interfaces/application_manager.mojom.h" |
| 12 #include "mojo/common/weak_binding_set.h" | 13 #include "mojo/common/weak_binding_set.h" |
| 13 #include "mojo/shell/application_manager.mojom.h" | |
| 14 | 14 |
| 15 namespace mojo { | 15 namespace mojo { |
| 16 namespace shell { | 16 namespace shell { |
| 17 class ApplicationManager; | 17 class ApplicationManager; |
| 18 | 18 |
| 19 class ShellApplicationDelegate | 19 class ShellApplicationDelegate |
| 20 : public ApplicationDelegate, | 20 : public ApplicationDelegate, |
| 21 public InterfaceFactory<mojom::ApplicationManager>, | 21 public InterfaceFactory<mojom::ApplicationManager>, |
| 22 public mojom::ApplicationManager { | 22 public mojom::ApplicationManager { |
| 23 public: | 23 public: |
| 24 explicit ShellApplicationDelegate(mojo::shell::ApplicationManager* manager); | 24 explicit ShellApplicationDelegate(mojo::shell::ApplicationManager* manager); |
| 25 ~ShellApplicationDelegate() override; | 25 ~ShellApplicationDelegate() override; |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 // Overridden from ApplicationDelegate: | 28 // Overridden from ApplicationDelegate: |
| 29 void Initialize(ApplicationImpl* app) override; | 29 void Initialize(ApplicationImpl* app) override; |
| 30 bool ConfigureIncomingConnection(ApplicationConnection* connection) override; | 30 bool ConfigureIncomingConnection(ApplicationConnection* connection) override; |
| 31 | 31 |
| 32 // Overridden from InterfaceFactory<mojom::ApplicationManager>: | 32 // Overridden from InterfaceFactory<mojom::ApplicationManager>: |
| 33 void Create( | 33 void Create( |
| 34 ApplicationConnection* connection, | 34 ApplicationConnection* connection, |
| 35 InterfaceRequest<mojom::ApplicationManager> request) override; | 35 InterfaceRequest<mojom::ApplicationManager> request) override; |
| 36 | 36 |
| 37 // Overridden from mojom::ApplicationManager: | 37 // Overridden from mojom::ApplicationManager: |
| 38 void CreateInstanceForHandle(ScopedHandle channel, | 38 void CreateInstanceForHandle(ScopedHandle channel, |
| 39 const String& url) override; | 39 const String& url, |
| 40 CapabilityFilterPtr filter) override; |
| 40 | 41 |
| 41 mojo::shell::ApplicationManager* manager_; | 42 mojo::shell::ApplicationManager* manager_; |
| 42 | 43 |
| 43 WeakBindingSet<mojom::ApplicationManager> bindings_; | 44 WeakBindingSet<mojom::ApplicationManager> bindings_; |
| 44 | 45 |
| 45 DISALLOW_COPY_AND_ASSIGN(ShellApplicationDelegate); | 46 DISALLOW_COPY_AND_ASSIGN(ShellApplicationDelegate); |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 } // namespace shell | 49 } // namespace shell |
| 49 } // namespace mojo | 50 } // namespace mojo |
| 50 | 51 |
| 51 #endif // MOJO_SHELL_SHELL_APPLICATION_DELEGATE_H_ | 52 #endif // MOJO_SHELL_SHELL_APPLICATION_DELEGATE_H_ |
| OLD | NEW |