| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_ | 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_ |
| 6 #define COMPONENTS_MUS_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_ | 6 #define COMPONENTS_MUS_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "components/mus/public/interfaces/input_events.mojom.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 |
| 11 namespace ui { |
| 12 class Event; |
| 13 } |
| 10 | 14 |
| 11 namespace mus { | 15 namespace mus { |
| 12 | 16 |
| 13 class Window; | 17 class Window; |
| 14 | 18 |
| 15 // Responsible for processing input events for mus::Window. | 19 // Responsible for processing input events for mus::Window. |
| 16 class InputEventHandler { | 20 class InputEventHandler { |
| 17 public: | 21 public: |
| 18 // The event handler can asynchronously ack the event by taking ownership of | 22 // The event handler can asynchronously ack the event by taking ownership of |
| 19 // the |ack_callback|. The callback takes a bool representing whether the | 23 // the |ack_callback|. The callback takes a bool representing whether the |
| 20 // handler has consumed the event. If the handler does not take ownership of | 24 // handler has consumed the event. If the handler does not take ownership of |
| 21 // the callback, then WindowTreeClientImpl will ack the event as not consumed. | 25 // the callback, then WindowTreeClientImpl will ack the event as not consumed. |
| 22 virtual void OnWindowInputEvent( | 26 virtual void OnWindowInputEvent( |
| 23 Window* target, | 27 Window* target, |
| 24 mojom::EventPtr event, | 28 const ui::Event& event, |
| 25 scoped_ptr<base::Callback<void(bool)>>* ack_callback) = 0; | 29 scoped_ptr<base::Callback<void(bool)>>* ack_callback) = 0; |
| 26 | 30 |
| 27 protected: | 31 protected: |
| 28 virtual ~InputEventHandler() {} | 32 virtual ~InputEventHandler() {} |
| 29 }; | 33 }; |
| 30 | 34 |
| 31 } // namespace mus | 35 } // namespace mus |
| 32 | 36 |
| 33 #endif // COMPONENTS_MUS_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_ | 37 #endif // COMPONENTS_MUS_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_ |
| OLD | NEW |