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 MOJO_SHELL_VIEW_MANAGER_LOADER_H_ | 5 #ifndef MOJO_SHELL_VIEW_MANAGER_LOADER_H_ |
6 #define MOJO_SHELL_VIEW_MANAGER_LOADER_H_ | 6 #define MOJO_SHELL_VIEW_MANAGER_LOADER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "mojo/public/cpp/application/application_delegate.h" | 10 #include "mojo/public/cpp/application/application_delegate.h" |
11 #include "mojo/service_manager/service_loader.h" | 11 #include "mojo/service_manager/service_loader.h" |
| 12 #include "mojo/services/view_manager/view_manager_init_service_context.h" |
12 | 13 |
13 namespace mojo { | 14 namespace mojo { |
14 | 15 |
15 class Application; | 16 class Application; |
16 | 17 |
17 namespace shell { | 18 namespace shell { |
18 | 19 |
19 // ServiceLoader responsible for creating connections to the ViewManager. | 20 // ServiceLoader responsible for creating connections to the ViewManager. |
20 class ViewManagerLoader : public ServiceLoader, public ApplicationDelegate { | 21 class ViewManagerLoader : public ServiceLoader, public ApplicationDelegate { |
21 public: | 22 public: |
22 ViewManagerLoader(); | 23 ViewManagerLoader(); |
23 virtual ~ViewManagerLoader(); | 24 virtual ~ViewManagerLoader(); |
24 | 25 |
25 private: | 26 private: |
26 // ServiceLoader overrides: | 27 // ServiceLoader overrides: |
27 virtual void LoadService( | 28 virtual void LoadService( |
28 ServiceManager* manager, | 29 ServiceManager* manager, |
29 const GURL& url, | 30 const GURL& url, |
30 ScopedMessagePipeHandle shell_handle) OVERRIDE; | 31 ScopedMessagePipeHandle shell_handle) OVERRIDE; |
31 virtual void OnServiceError(ServiceManager* manager, | 32 virtual void OnServiceError(ServiceManager* manager, |
32 const GURL& url) OVERRIDE; | 33 const GURL& url) OVERRIDE; |
33 | 34 |
34 // ApplicationDelegate overrides. | 35 // ApplicationDelegate overrides. |
35 virtual bool ConfigureIncomingConnection( | 36 virtual bool ConfigureIncomingConnection( |
36 mojo::ApplicationConnection* connection) MOJO_OVERRIDE; | 37 mojo::ApplicationConnection* connection) MOJO_OVERRIDE; |
37 | 38 |
38 ScopedVector<Application> apps_; | 39 ScopedVector<Application> apps_; |
| 40 view_manager::service::ViewManagerInitServiceContext context_; |
39 | 41 |
40 DISALLOW_COPY_AND_ASSIGN(ViewManagerLoader); | 42 DISALLOW_COPY_AND_ASSIGN(ViewManagerLoader); |
41 }; | 43 }; |
42 | 44 |
43 } // namespace shell | 45 } // namespace shell |
44 } // namespace mojo | 46 } // namespace mojo |
45 | 47 |
46 #endif // MOJO_SHELL_VIEW_MANAGER_LOADER_H_ | 48 #endif // MOJO_SHELL_VIEW_MANAGER_LOADER_H_ |
OLD | NEW |