OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_CHROMEOS_XINPUT_HIERARCHY_CHANGED_EVENT_LISTENER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_XINPUT_HIERARCHY_CHANGED_EVENT_LISTENER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_XINPUT_HIERARCHY_CHANGED_EVENT_LISTENER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_XINPUT_HIERARCHY_CHANGED_EVENT_LISTENER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 // TODO(yusukes): Remove the #if once the ARM bot (crbug.com/84694) is fixed. | 9 // TODO(yusukes): Remove the #if once the ARM bot (crbug.com/84694) is fixed. |
10 #if defined(HAVE_XINPUT2) | 10 #if defined(HAVE_XINPUT2) |
(...skipping 18 matching lines...) Expand all Loading... |
29 void Stop(); | 29 void Stop(); |
30 | 30 |
31 private: | 31 private: |
32 // Defines the delete on exit Singleton traits we like. Best to have this | 32 // Defines the delete on exit Singleton traits we like. Best to have this |
33 // and const/dest private as recommended for Singletons. | 33 // and const/dest private as recommended for Singletons. |
34 friend struct DefaultSingletonTraits<XInputHierarchyChangedEventListener>; | 34 friend struct DefaultSingletonTraits<XInputHierarchyChangedEventListener>; |
35 | 35 |
36 XInputHierarchyChangedEventListener(); | 36 XInputHierarchyChangedEventListener(); |
37 virtual ~XInputHierarchyChangedEventListener(); | 37 virtual ~XInputHierarchyChangedEventListener(); |
38 | 38 |
| 39 #if defined(TOUCH_UI) |
| 40 // MessageLoopForUI::Observer overrides. |
| 41 virtual EventStatus WillProcessXEvent(XEvent* xevent) OVERRIDE; |
| 42 #else |
39 // When TOUCH_UI is not defined, WillProcessXEvent() will not be called | 43 // When TOUCH_UI is not defined, WillProcessXEvent() will not be called |
40 // automatically. We have to call the function manually by adding the Gdk | 44 // automatically. We have to call the function manually by adding the Gdk |
41 // event filter. | 45 // event filter. |
42 static GdkFilterReturn GdkEventFilter(GdkXEvent* gxevent, | 46 static GdkFilterReturn GdkEventFilter(GdkXEvent* gxevent, |
43 GdkEvent* gevent, | 47 GdkEvent* gevent, |
44 gpointer data); | 48 gpointer data); |
45 | 49 |
46 // MessageLoopForUI::Observer overrides. | 50 // MessageLoopForUI::Observer overrides. |
47 virtual void WillProcessEvent(GdkEvent* event) OVERRIDE {} | 51 virtual void WillProcessEvent(GdkEvent* event) OVERRIDE {} |
48 virtual void DidProcessEvent(GdkEvent* event) OVERRIDE {} | 52 virtual void DidProcessEvent(GdkEvent* event) OVERRIDE {} |
49 virtual bool WillProcessXEvent(XEvent* xevent) | |
50 #if defined(TOUCH_UI) | |
51 OVERRIDE | |
52 #endif | 53 #endif |
53 ; | 54 |
| 55 // Returns true if the event was processed, false otherwise. |
| 56 virtual bool ProcessedXEvent(XEvent* xevent); |
54 | 57 |
55 bool stopped_; | 58 bool stopped_; |
56 int xiopcode_; | 59 int xiopcode_; |
57 | 60 |
58 DISALLOW_COPY_AND_ASSIGN(XInputHierarchyChangedEventListener); | 61 DISALLOW_COPY_AND_ASSIGN(XInputHierarchyChangedEventListener); |
59 }; | 62 }; |
60 | 63 |
61 } // namespace chromeos | 64 } // namespace chromeos |
62 | 65 |
63 #endif | 66 #endif |
64 #endif // CHROME_BROWSER_CHROMEOS_XINPUT_HIERARCHY_CHANGED_EVENT_LISTENER_H_ | 67 #endif // CHROME_BROWSER_CHROMEOS_XINPUT_HIERARCHY_CHANGED_EVENT_LISTENER_H_ |
OLD | NEW |