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 MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_ | 5 #ifndef MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_ |
6 #define MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_ | 6 #define MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "components/clipboard/public/interfaces/clipboard.mojom.h" | 11 #include "components/clipboard/public/interfaces/clipboard.mojom.h" |
12 #include "mojo/common/weak_binding_set.h" | 12 #include "mojo/common/weak_binding_set.h" |
13 #include "mojo/services/tracing/public/cpp/tracing_impl.h" | 13 #include "mojo/services/tracing/public/cpp/tracing_impl.h" |
14 #include "mojo/shell/public/cpp/application_delegate.h" | 14 #include "mojo/shell/public/cpp/application_delegate.h" |
15 #include "mojo/shell/public/cpp/interface_factory_impl.h" | 15 #include "mojo/shell/public/cpp/interface_factory_impl.h" |
16 #include "mojo/shell/public/interfaces/content_handler.mojom.h" | 16 #include "mojo/shell/public/interfaces/content_handler.mojom.h" |
17 | 17 |
18 namespace core_services { | 18 namespace core_services { |
19 | 19 |
20 class ApplicationThread; | 20 class ApplicationThread; |
21 | 21 |
22 // The CoreServices application is a singleton ServiceProvider. There is one | 22 // The CoreServices application is a singleton ServiceProvider. There is one |
23 // instance of the CoreServices ServiceProvider. | 23 // instance of the CoreServices ServiceProvider. |
24 class CoreServicesApplicationDelegate | 24 class CoreServicesApplicationDelegate |
25 : public mojo::ApplicationDelegate, | 25 : public mojo::ApplicationDelegate, |
26 public mojo::InterfaceFactory<mojo::ContentHandler>, | 26 public mojo::InterfaceFactory<mojo::shell::mojom::ContentHandler>, |
27 public mojo::ContentHandler { | 27 public mojo::shell::mojom::ContentHandler { |
28 public: | 28 public: |
29 CoreServicesApplicationDelegate(); | 29 CoreServicesApplicationDelegate(); |
30 ~CoreServicesApplicationDelegate() override; | 30 ~CoreServicesApplicationDelegate() override; |
31 | 31 |
32 void ApplicationThreadDestroyed(ApplicationThread* thread); | 32 void ApplicationThreadDestroyed(ApplicationThread* thread); |
33 | 33 |
34 private: | 34 private: |
35 // Overridden from mojo::ApplicationDelegate: | 35 // Overridden from mojo::ApplicationDelegate: |
36 void Initialize(mojo::ApplicationImpl* app) override; | 36 void Initialize(mojo::ApplicationImpl* app) override; |
37 bool AcceptConnection( | 37 bool AcceptConnection( |
38 mojo::ApplicationConnection* connection) override; | 38 mojo::ApplicationConnection* connection) override; |
39 void Quit() override; | 39 void Quit() override; |
40 | 40 |
41 // Overridden from mojo::InterfaceFactory<mojo::ContentHandler>: | 41 // Overridden from mojo::InterfaceFactory<mojo::shell::mojom::ContentHandler>: |
42 void Create(mojo::ApplicationConnection* connection, | 42 void Create( |
43 mojo::InterfaceRequest<mojo::ContentHandler> request) override; | 43 mojo::ApplicationConnection* connection, |
| 44 mojo::InterfaceRequest<mojo::shell::mojom::ContentHandler> |
| 45 request) override; |
44 | 46 |
45 // Overridden from mojo::ContentHandler: | 47 // Overridden from mojo::shell::mojom::ContentHandler: |
46 void StartApplication( | 48 void StartApplication( |
47 mojo::InterfaceRequest<mojo::Application> request, | 49 mojo::InterfaceRequest<mojo::shell::mojom::Application> request, |
48 mojo::URLResponsePtr response, | 50 mojo::URLResponsePtr response, |
49 const mojo::Callback<void()>& destruct_callback) override; | 51 const mojo::Callback<void()>& destruct_callback) override; |
50 | 52 |
51 // Bindings for all of our connections. | 53 // Bindings for all of our connections. |
52 mojo::WeakBindingSet<ContentHandler> handler_bindings_; | 54 mojo::WeakBindingSet<mojo::shell::mojom::ContentHandler> handler_bindings_; |
53 | 55 |
54 ScopedVector<ApplicationThread> application_threads_; | 56 ScopedVector<ApplicationThread> application_threads_; |
55 mojo::TracingImpl tracing_; | 57 mojo::TracingImpl tracing_; |
56 | 58 |
57 base::WeakPtrFactory<CoreServicesApplicationDelegate> weak_factory_; | 59 base::WeakPtrFactory<CoreServicesApplicationDelegate> weak_factory_; |
58 | 60 |
59 DISALLOW_COPY_AND_ASSIGN(CoreServicesApplicationDelegate); | 61 DISALLOW_COPY_AND_ASSIGN(CoreServicesApplicationDelegate); |
60 }; | 62 }; |
61 | 63 |
62 } // namespace core_services | 64 } // namespace core_services |
63 | 65 |
64 #endif // MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H
_ | 66 #endif // MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H
_ |
OLD | NEW |