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 "ui/display/chromeos/x11/native_display_event_dispatcher_x11.h" |
| 6 |
| 7 #include <X11/extensions/Xrandr.h> |
| 8 #include <utility> |
| 9 |
5 #include "base/time/default_tick_clock.h" | 10 #include "base/time/default_tick_clock.h" |
6 #include "ui/display/chromeos/x11/native_display_event_dispatcher_x11.h" | |
7 #include "ui/display/chromeos/x11/display_mode_x11.h" | 11 #include "ui/display/chromeos/x11/display_mode_x11.h" |
8 #include "ui/display/chromeos/x11/display_snapshot_x11.h" | 12 #include "ui/display/chromeos/x11/display_snapshot_x11.h" |
9 #include "ui/events/platform/platform_event_source.h" | 13 #include "ui/events/platform/platform_event_source.h" |
10 | 14 |
11 #include <X11/extensions/Xrandr.h> | |
12 | |
13 namespace ui { | 15 namespace ui { |
14 | 16 |
15 // static | 17 // static |
16 const int NativeDisplayEventDispatcherX11::kUseCacheAfterStartupMs = 7000; | 18 const int NativeDisplayEventDispatcherX11::kUseCacheAfterStartupMs = 7000; |
17 | 19 |
18 NativeDisplayEventDispatcherX11::NativeDisplayEventDispatcherX11( | 20 NativeDisplayEventDispatcherX11::NativeDisplayEventDispatcherX11( |
19 NativeDisplayDelegateX11::HelperDelegate* delegate, | 21 NativeDisplayDelegateX11::HelperDelegate* delegate, |
20 int xrandr_event_base) | 22 int xrandr_event_base) |
21 : delegate_(delegate), | 23 : delegate_(delegate), |
22 xrandr_event_base_(xrandr_event_base), | 24 xrandr_event_base_(xrandr_event_base), |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 } | 103 } |
102 } | 104 } |
103 | 105 |
104 delegate_->NotifyDisplayObservers(); | 106 delegate_->NotifyDisplayObservers(); |
105 | 107 |
106 return ui::POST_DISPATCH_PERFORM_DEFAULT; | 108 return ui::POST_DISPATCH_PERFORM_DEFAULT; |
107 } | 109 } |
108 | 110 |
109 void NativeDisplayEventDispatcherX11::SetTickClockForTest( | 111 void NativeDisplayEventDispatcherX11::SetTickClockForTest( |
110 scoped_ptr<base::TickClock> tick_clock) { | 112 scoped_ptr<base::TickClock> tick_clock) { |
111 tick_clock_ = tick_clock.Pass(); | 113 tick_clock_ = std::move(tick_clock); |
112 startup_time_ = tick_clock_->NowTicks(); | 114 startup_time_ = tick_clock_->NowTicks(); |
113 } | 115 } |
114 | 116 |
115 } // namespace ui | 117 } // namespace ui |
OLD | NEW |