| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROMEOS_DISPLAY_NATIVE_DISPLAY_EVENT_DISPATCHER_X11_H_ | |
| 6 #define CHROMEOS_DISPLAY_NATIVE_DISPLAY_EVENT_DISPATCHER_X11_H_ | |
| 7 | |
| 8 #include "base/message_loop/message_pump_dispatcher.h" | |
| 9 #include "chromeos/display/native_display_delegate_x11.h" | |
| 10 | |
| 11 namespace chromeos { | |
| 12 | |
| 13 class CHROMEOS_EXPORT NativeDisplayEventDispatcherX11 | |
| 14 : public base::MessagePumpDispatcher { | |
| 15 public: | |
| 16 NativeDisplayEventDispatcherX11( | |
| 17 NativeDisplayDelegateX11::HelperDelegate* delegate, | |
| 18 int xrandr_event_base); | |
| 19 virtual ~NativeDisplayEventDispatcherX11(); | |
| 20 | |
| 21 // base::MessagePumpDispatcher overrides: | |
| 22 // | |
| 23 // Called when an RRNotify event is received. The implementation is | |
| 24 // interested in the cases of RRNotify events which correspond to output | |
| 25 // add/remove events. Note that Output add/remove events are sent in response | |
| 26 // to our own reconfiguration operations so spurious events are common. | |
| 27 // Spurious events will have no effect. | |
| 28 virtual uint32_t Dispatch(const base::NativeEvent& event) OVERRIDE; | |
| 29 | |
| 30 private: | |
| 31 NativeDisplayDelegateX11::HelperDelegate* delegate_; // Not owned. | |
| 32 | |
| 33 // The base of the event numbers used to represent XRandr events used in | |
| 34 // decoding events regarding output add/remove. | |
| 35 int xrandr_event_base_; | |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(NativeDisplayEventDispatcherX11); | |
| 38 }; | |
| 39 | |
| 40 } // namespace chromeos | |
| 41 | |
| 42 #endif // CHROMEOS_DISPLAY_NATIVE_DISPLAY_EVENT_DISPATCHER_X11_H_ | |
| OLD | NEW |