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

Side by Side Diff: services/ui/public/cpp/input_event_handler.h

Issue 2189893002: services/ui: Create a proper component for the client-lib. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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 | « services/ui/public/cpp/gles2_context.h ('k') | services/ui/public/cpp/lib/window_private.h » ('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 SERVICES_UI_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_ 5 #ifndef SERVICES_UI_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_
6 #define SERVICES_UI_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_ 6 #define SERVICES_UI_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
11 #include "services/ui/public/cpp/ui_export.h"
11 12
12 namespace ui { 13 namespace ui {
13 class Event; 14 class Event;
14 } 15 }
15 16
16 namespace ui { 17 namespace ui {
17 18
18 class Window; 19 class Window;
19 20
20 namespace mojom { 21 namespace mojom {
21 enum class EventResult; 22 enum class EventResult;
22 } 23 }
23 24
24 // Responsible for processing input events for ui::Window. 25 // Responsible for processing input events for ui::Window.
25 class InputEventHandler { 26 class UI_EXPORT InputEventHandler {
26 public: 27 public:
27 // The event handler can asynchronously ack the event by taking ownership of 28 // The event handler can asynchronously ack the event by taking ownership of
28 // the |ack_callback|. The callback takes an EventResult indicating if the 29 // the |ack_callback|. The callback takes an EventResult indicating if the
29 // handler has consumed the event. If the handler does not take ownership of 30 // handler has consumed the event. If the handler does not take ownership of
30 // the callback, then WindowTreeClient will ack the event as not consumed. 31 // the callback, then WindowTreeClient will ack the event as not consumed.
31 virtual void OnWindowInputEvent( 32 virtual void OnWindowInputEvent(
32 Window* target, 33 Window* target,
33 const ui::Event& event, 34 const ui::Event& event,
34 std::unique_ptr<base::Callback<void(mojom::EventResult)>>* 35 std::unique_ptr<base::Callback<void(mojom::EventResult)>>*
35 ack_callback) = 0; 36 ack_callback) = 0;
36 37
37 protected: 38 protected:
38 virtual ~InputEventHandler() {} 39 virtual ~InputEventHandler() {}
39 }; 40 };
40 41
41 } // namespace ui 42 } // namespace ui
42 43
43 #endif // SERVICES_UI_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_ 44 #endif // SERVICES_UI_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_
OLDNEW
« no previous file with comments | « services/ui/public/cpp/gles2_context.h ('k') | services/ui/public/cpp/lib/window_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698