Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / mojo / shell / view_manager_loader.h
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_SHELL_VIEW_MANAGER_LOADER_H_
6 #define MOJO_SHELL_VIEW_MANAGER_LOADER_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/scoped_vector.h"
10 #include "mojo/service_manager/service_loader.h"
11
12 namespace mojo {
13 namespace services {
14 namespace view_manager {
15 class RootNodeManager;
16 }
17 }
18
19 class Application;
20
21 namespace shell {
22
23 // ServiceLoader responsible for creating connections to the ViewManager.
24 class ViewManagerLoader : public ServiceLoader {
25  public:
26   ViewManagerLoader();
27   virtual ~ViewManagerLoader();
28
29  private:
30   // ServiceLoader overrides:
31   virtual void LoadService(ServiceManager* manager,
32                            const GURL& url,
33                            ScopedMessagePipeHandle shell_handle) OVERRIDE;
34   virtual void OnServiceError(ServiceManager* manager,
35                               const GURL& url) OVERRIDE;
36
37   scoped_ptr<services::view_manager::RootNodeManager> root_node_manager_;
38   ScopedVector<Application> apps_;
39
40   DISALLOW_COPY_AND_ASSIGN(ViewManagerLoader);
41 };
42
43 }  // namespace shell
44 }  // namespace mojo
45
46 #endif  // MOJO_SHELL_VIEW_MANAGER_LOADER_H_