summaryrefslogtreecommitdiffstats
path: root/components/mus/public/cpp/input_event_handler.h
blob: ebd159717f58f48c16b513f5cb33b3171a4b20c7 (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
// 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_MUS_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_
#define COMPONENTS_MUS_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_

#include "base/callback_forward.h"
#include "components/mus/public/interfaces/input_events.mojom.h"

namespace mus {

class Window;

// Responsible for processing input events for mus::Window.
class InputEventHandler {
 public:
  // The event handler can asynchronously ack the event by taking ownership of
  // the |ack_callback|. If the handler does not take ownership of the callback,
  // then WindowTreeClientImpl will ack the event.
  virtual void OnWindowInputEvent(Window* target,
                                  mojom::EventPtr event,
                                  scoped_ptr<base::Closure>* ack_callback) = 0;
 protected:
  virtual ~InputEventHandler() {}
};

}  // namespace mus

#endif  // COMPONENTS_MUS_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_