summaryrefslogtreecommitdiffstats
path: root/mash/browser_driver/browser_driver_application_delegate.h
blob: 229d0c94ebc3adbc01dc93582ffa2c811e16489d (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
49
50
51
52
// 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 MASH_BROWSER_DRIVER_BROWSER_DRIVER_APPLICATION_DELEGATE_H_
#define MASH_BROWSER_DRIVER_BROWSER_DRIVER_APPLICATION_DELEGATE_H_

#include <stdint.h>

#include <map>

#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "components/mus/public/interfaces/accelerator_registrar.mojom.h"
#include "mojo/application/public/cpp/application_delegate.h"
#include "mojo/public/cpp/bindings/binding.h"

namespace mojo {
class ApplicationConnection;
}

namespace mash {
namespace browser_driver {

class BrowserDriverApplicationDelegate : public mojo::ApplicationDelegate,
                                         public mus::mojom::AcceleratorHandler {
 public:
  BrowserDriverApplicationDelegate();
  ~BrowserDriverApplicationDelegate() override;

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

  // mus::mojom::AcceleratorHandler:
  void OnAccelerator(uint32_t id, mus::mojom::EventPtr event) override;

  void AddAccelerators();

  mojo::ApplicationImpl* app_;
  mojo::Binding<mus::mojom::AcceleratorHandler> binding_;

  DISALLOW_COPY_AND_ASSIGN(BrowserDriverApplicationDelegate);
};

}  // namespace browser_driver
}  // namespace mash

#endif  // MASH_BROWSER_DRIVER_BROWSER_DRIVER_APPLICATION_DELEGATE_H_