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" | |
13 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/strings/stringprintf.h" | |
14 #include "base/trace_event/trace_event.h" | 16 #include "base/trace_event/trace_event.h" |
15 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
16 #include "ui/aura/window_event_dispatcher.h" | 18 #include "ui/aura/window_event_dispatcher.h" |
17 #include "ui/aura/window_tree_host.h" | 19 #include "ui/aura/window_tree_host.h" |
18 #include "ui/base/layout.h" | 20 #include "ui/base/layout.h" |
19 #include "ui/display/util/display_util.h" | 21 #include "ui/display/util/display_util.h" |
20 #include "ui/display/util/x11/edid_parser_x11.h" | 22 #include "ui/display/util/x11/edid_parser_x11.h" |
21 #include "ui/events/platform/platform_event_source.h" | 23 #include "ui/events/platform/platform_event_source.h" |
22 #include "ui/gfx/display.h" | 24 #include "ui/gfx/display.h" |
23 #include "ui/gfx/geometry/point_conversions.h" | 25 #include "ui/gfx/geometry/point_conversions.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
245 this, | 247 this, |
246 &DesktopScreenX11::ConfigureTimerFired); | 248 &DesktopScreenX11::ConfigureTimerFired); |
247 } | 249 } |
248 } else { | 250 } else { |
249 NOTREACHED(); | 251 NOTREACHED(); |
250 } | 252 } |
251 | 253 |
252 return ui::POST_DISPATCH_NONE; | 254 return ui::POST_DISPATCH_NONE; |
253 } | 255 } |
254 | 256 |
257 // static | |
258 void DesktopScreenX11::UpdateDeviceScaleFactorForTest() { | |
259 DesktopScreenX11* screen = | |
260 static_cast<DesktopScreenX11*>(gfx::Screen::GetNativeScreen()); | |
261 screen->ConfigureTimerFired(); | |
262 } | |
263 | |
sadrul
2015/12/16 19:13:19
Perhaps this could go in a TestApi instead.
| |
255 //////////////////////////////////////////////////////////////////////////////// | 264 //////////////////////////////////////////////////////////////////////////////// |
256 // DesktopScreenX11, private: | 265 // DesktopScreenX11, private: |
257 | 266 |
258 DesktopScreenX11::DesktopScreenX11( | 267 DesktopScreenX11::DesktopScreenX11( |
259 const std::vector<gfx::Display>& test_displays) | 268 const std::vector<gfx::Display>& test_displays) |
260 : xdisplay_(gfx::GetXDisplay()), | 269 : xdisplay_(gfx::GetXDisplay()), |
261 x_root_window_(DefaultRootWindow(xdisplay_)), | 270 x_root_window_(DefaultRootWindow(xdisplay_)), |
262 has_xrandr_(false), | 271 has_xrandr_(false), |
263 xrandr_event_base_(0), | 272 xrandr_event_base_(0), |
264 displays_(test_displays) { | 273 displays_(test_displays) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
360 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); | 369 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); |
361 } | 370 } |
362 | 371 |
363 //////////////////////////////////////////////////////////////////////////////// | 372 //////////////////////////////////////////////////////////////////////////////// |
364 | 373 |
365 gfx::Screen* CreateDesktopScreen() { | 374 gfx::Screen* CreateDesktopScreen() { |
366 return new DesktopScreenX11; | 375 return new DesktopScreenX11; |
367 } | 376 } |
368 | 377 |
369 } // namespace views | 378 } // namespace views |
OLD | NEW |