summaryrefslogtreecommitdiffstats
path: root/mojo/shell/view_manager_loader.h
blob: e978b7641fa65e976a2059b7e5ef25b785bbaf48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MOJO_SHELL_VIEW_MANAGER_LOADER_H_
#define MOJO_SHELL_VIEW_MANAGER_LOADER_H_

#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "mojo/service_manager/service_loader.h"

namespace mojo {
namespace view_manager {
namespace service {
class RootNodeManager;
}
}

class Application;

namespace shell {

// ServiceLoader responsible for creating connections to the ViewManager.
class ViewManagerLoader : public ServiceLoader {
 public:
  ViewManagerLoader();
  virtual ~ViewManagerLoader();

 private:
  // ServiceLoader overrides:
  virtual void LoadService(
      ServiceManager* manager,
      const GURL& url,
      ScopedMessagePipeHandle service_provider_handle) OVERRIDE;
  virtual void OnServiceError(ServiceManager* manager,
                              const GURL& url) OVERRIDE;

  scoped_ptr<view_manager::service::RootNodeManager> root_node_manager_;
  ScopedVector<Application> apps_;

  DISALLOW_COPY_AND_ASSIGN(ViewManagerLoader);
};

}  // namespace shell
}  // namespace mojo

#endif  // MOJO_SHELL_VIEW_MANAGER_LOADER_H_