Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: components/mus/public/cpp/input_event_handler.h

Issue 1891413002: mash: Convert OnWindowInputEventAck to use an enum for handled status (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missed a file Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/mus/public/cpp/lib/window_tree_client_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 10
11 namespace ui { 11 namespace ui {
12 class Event; 12 class Event;
13 } 13 }
14 14
15 namespace mus { 15 namespace mus {
16 16
17 class Window; 17 class Window;
18 18
19 namespace mojom {
20 enum class EventResult;
21 }
22
19 // Responsible for processing input events for mus::Window. 23 // Responsible for processing input events for mus::Window.
20 class InputEventHandler { 24 class InputEventHandler {
21 public: 25 public:
22 // The event handler can asynchronously ack the event by taking ownership of 26 // The event handler can asynchronously ack the event by taking ownership of
23 // the |ack_callback|. The callback takes a bool representing whether the 27 // the |ack_callback|. The callback takes an EventResult indicating if the
24 // handler has consumed the event. If the handler does not take ownership of 28 // handler has consumed the event. If the handler does not take ownership of
25 // the callback, then WindowTreeClientImpl will ack the event as not consumed. 29 // the callback, then WindowTreeClientImpl will ack the event as not consumed.
26 virtual void OnWindowInputEvent( 30 virtual void OnWindowInputEvent(
27 Window* target, 31 Window* target,
28 const ui::Event& event, 32 const ui::Event& event,
29 scoped_ptr<base::Callback<void(bool)>>* ack_callback) = 0; 33 scoped_ptr<base::Callback<void(mojom::EventResult)>>* ack_callback) = 0;
30 34
31 protected: 35 protected:
32 virtual ~InputEventHandler() {} 36 virtual ~InputEventHandler() {}
33 }; 37 };
34 38
35 } // namespace mus 39 } // namespace mus
36 40
37 #endif // COMPONENTS_MUS_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_ 41 #endif // COMPONENTS_MUS_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | components/mus/public/cpp/lib/window_tree_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698