OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/views/widget/desktop_aura/desktop_screen_x11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_screen_x11.h" |
6 | 6 |
7 #include <X11/extensions/Xrandr.h> | 7 #include <X11/extensions/Xrandr.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 | 9 |
10 // It clashes with out RootWindow. | 10 // It clashes with out RootWindow. |
11 #undef RootWindow | 11 #undef RootWindow |
12 | 12 |
13 #include "base/command_line.h" | |
14 #include "base/logging.h" | 13 #include "base/logging.h" |
15 #include "base/strings/stringprintf.h" | |
16 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
17 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
18 #include "ui/aura/window_event_dispatcher.h" | 16 #include "ui/aura/window_event_dispatcher.h" |
19 #include "ui/aura/window_tree_host.h" | 17 #include "ui/aura/window_tree_host.h" |
20 #include "ui/base/layout.h" | 18 #include "ui/base/layout.h" |
21 #include "ui/display/util/display_util.h" | 19 #include "ui/display/util/display_util.h" |
22 #include "ui/display/util/x11/edid_parser_x11.h" | 20 #include "ui/display/util/x11/edid_parser_x11.h" |
23 #include "ui/events/platform/platform_event_source.h" | 21 #include "ui/events/platform/platform_event_source.h" |
24 #include "ui/gfx/display.h" | 22 #include "ui/gfx/display.h" |
25 #include "ui/gfx/geometry/point_conversions.h" | 23 #include "ui/gfx/geometry/point_conversions.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 this, | 245 this, |
248 &DesktopScreenX11::ConfigureTimerFired); | 246 &DesktopScreenX11::ConfigureTimerFired); |
249 } | 247 } |
250 } else { | 248 } else { |
251 NOTREACHED(); | 249 NOTREACHED(); |
252 } | 250 } |
253 | 251 |
254 return ui::POST_DISPATCH_NONE; | 252 return ui::POST_DISPATCH_NONE; |
255 } | 253 } |
256 | 254 |
| 255 // static |
| 256 void DesktopScreenX11::UpdateDeviceScaleFactorForTest() { |
| 257 DesktopScreenX11* screen = |
| 258 static_cast<DesktopScreenX11*>(gfx::Screen::GetNativeScreen()); |
| 259 screen->ConfigureTimerFired(); |
| 260 } |
| 261 |
257 //////////////////////////////////////////////////////////////////////////////// | 262 //////////////////////////////////////////////////////////////////////////////// |
258 // DesktopScreenX11, private: | 263 // DesktopScreenX11, private: |
259 | 264 |
260 DesktopScreenX11::DesktopScreenX11( | 265 DesktopScreenX11::DesktopScreenX11( |
261 const std::vector<gfx::Display>& test_displays) | 266 const std::vector<gfx::Display>& test_displays) |
262 : xdisplay_(gfx::GetXDisplay()), | 267 : xdisplay_(gfx::GetXDisplay()), |
263 x_root_window_(DefaultRootWindow(xdisplay_)), | 268 x_root_window_(DefaultRootWindow(xdisplay_)), |
264 has_xrandr_(false), | 269 has_xrandr_(false), |
265 xrandr_event_base_(0), | 270 xrandr_event_base_(0), |
266 displays_(test_displays) { | 271 displays_(test_displays) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); | 367 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); |
363 } | 368 } |
364 | 369 |
365 //////////////////////////////////////////////////////////////////////////////// | 370 //////////////////////////////////////////////////////////////////////////////// |
366 | 371 |
367 gfx::Screen* CreateDesktopScreen() { | 372 gfx::Screen* CreateDesktopScreen() { |
368 return new DesktopScreenX11; | 373 return new DesktopScreenX11; |
369 } | 374 } |
370 | 375 |
371 } // namespace views | 376 } // namespace views |
OLD | NEW |