summaryrefslogtreecommitdiffstats
path: root/components/devtools_service/devtools_service_delegate.h
blob: 966e90f2ad5822f31ed7f0258b46c108ac0e64ce (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
48
// Copyright 2015 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 COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_SERVICE_DELEGATE_H_
#define COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_SERVICE_DELEGATE_H_

#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "components/devtools_service/public/interfaces/devtools_service.mojom.h"
#include "mojo/shell/public/cpp/application_delegate.h"
#include "mojo/shell/public/cpp/interface_factory.h"

namespace devtools_service {

class DevToolsService;

class DevToolsServiceDelegate
    : public mojo::ApplicationDelegate,
      public mojo::InterfaceFactory<DevToolsRegistry>,
      public mojo::InterfaceFactory<DevToolsCoordinator> {
 public:
  DevToolsServiceDelegate();
  ~DevToolsServiceDelegate() override;

 private:
  // mojo::ApplicationDelegate implementation.
  void Initialize(mojo::ApplicationImpl* app) override;
  bool ConfigureIncomingConnection(
      mojo::ApplicationConnection* connection) override;
  void Quit() override;

  // mojo::InterfaceFactory<DevToolsRegistry> implementation.
  void Create(mojo::ApplicationConnection* connection,
              mojo::InterfaceRequest<DevToolsRegistry> request) override;

  // mojo::InterfaceFactory<DevToolsCoordinator> implementation.
  void Create(mojo::ApplicationConnection* connection,
              mojo::InterfaceRequest<DevToolsCoordinator> request) override;

  scoped_ptr<DevToolsService> service_;

  DISALLOW_COPY_AND_ASSIGN(DevToolsServiceDelegate);
};

}  // namespace devtools_service

#endif  // COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_SERVICE_DELEGATE_H_