OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #include "base/time/default_tick_clock.h" | 5 #include "base/time/default_tick_clock.h" |
6 #include "ui/display/chromeos/x11/native_display_event_dispatcher_x11.h" | 6 #include "ui/display/chromeos/x11/native_display_event_dispatcher_x11.h" |
7 #include "ui/display/chromeos/x11/display_mode_x11.h" | 7 #include "ui/display/chromeos/x11/display_mode_x11.h" |
8 #include "ui/display/chromeos/x11/display_snapshot_x11.h" | 8 #include "ui/display/chromeos/x11/display_snapshot_x11.h" |
9 #include "ui/events/platform/platform_event_source.h" | 9 #include "ui/events/platform/platform_event_source.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 } | 25 } |
26 | 26 |
27 NativeDisplayEventDispatcherX11::~NativeDisplayEventDispatcherX11() {} | 27 NativeDisplayEventDispatcherX11::~NativeDisplayEventDispatcherX11() {} |
28 | 28 |
29 bool NativeDisplayEventDispatcherX11::CanDispatchEvent( | 29 bool NativeDisplayEventDispatcherX11::CanDispatchEvent( |
30 const PlatformEvent& event) { | 30 const PlatformEvent& event) { |
31 return (event->type - xrandr_event_base_ == RRScreenChangeNotify) || | 31 return (event->type - xrandr_event_base_ == RRScreenChangeNotify) || |
32 (event->type - xrandr_event_base_ == RRNotify); | 32 (event->type - xrandr_event_base_ == RRNotify); |
33 } | 33 } |
34 | 34 |
35 uint32_t NativeDisplayEventDispatcherX11::DispatchEvent( | 35 ui::PostDispatchAction NativeDisplayEventDispatcherX11::DispatchEvent( |
36 const PlatformEvent& event) { | 36 const PlatformEvent& event) { |
37 if (event->type - xrandr_event_base_ == RRScreenChangeNotify) { | 37 if (event->type - xrandr_event_base_ == RRScreenChangeNotify) { |
38 VLOG(1) << "Received RRScreenChangeNotify event"; | 38 VLOG(1) << "Received RRScreenChangeNotify event"; |
39 delegate_->UpdateXRandRConfiguration(event); | 39 delegate_->UpdateXRandRConfiguration(event); |
40 return ui::POST_DISPATCH_PERFORM_DEFAULT; | 40 return ui::POST_DISPATCH_PERFORM_DEFAULT; |
41 } | 41 } |
42 | 42 |
43 // Bail out early for everything except RRNotify_OutputChange events | 43 // Bail out early for everything except RRNotify_OutputChange events |
44 // about an output getting connected or disconnected. | 44 // about an output getting connected or disconnected. |
45 if (event->type - xrandr_event_base_ != RRNotify) | 45 if (event->type - xrandr_event_base_ != RRNotify) |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 return ui::POST_DISPATCH_PERFORM_DEFAULT; | 98 return ui::POST_DISPATCH_PERFORM_DEFAULT; |
99 } | 99 } |
100 | 100 |
101 void NativeDisplayEventDispatcherX11::SetTickClockForTest( | 101 void NativeDisplayEventDispatcherX11::SetTickClockForTest( |
102 scoped_ptr<base::TickClock> tick_clock) { | 102 scoped_ptr<base::TickClock> tick_clock) { |
103 tick_clock_ = tick_clock.Pass(); | 103 tick_clock_ = tick_clock.Pass(); |
104 startup_time_ = tick_clock_->NowTicks(); | 104 startup_time_ = tick_clock_->NowTicks(); |
105 } | 105 } |
106 | 106 |
107 } // namespace ui | 107 } // namespace ui |
OLD | NEW |