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. |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 } | 398 } |
399 | 399 |
400 void DesktopScreenX11::SetDisplaysInternal( | 400 void DesktopScreenX11::SetDisplaysInternal( |
401 const std::vector<display::Display>& displays) { | 401 const std::vector<display::Display>& displays) { |
402 displays_ = displays; | 402 displays_ = displays; |
403 gfx::SetFontRenderParamsDeviceScaleFactor( | 403 gfx::SetFontRenderParamsDeviceScaleFactor( |
404 GetPrimaryDisplay().device_scale_factor()); | 404 GetPrimaryDisplay().device_scale_factor()); |
405 } | 405 } |
406 | 406 |
407 //////////////////////////////////////////////////////////////////////////////// | 407 //////////////////////////////////////////////////////////////////////////////// |
| 408 // TestDesktopScreenX11, public: |
| 409 |
| 410 TestDesktopScreenX11::TestDesktopScreenX11() {} |
| 411 |
| 412 TestDesktopScreenX11::~TestDesktopScreenX11() {} |
| 413 |
| 414 gfx::Point TestDesktopScreenX11::GetCursorScreenPoint() { |
| 415 return cursor_screen_point_; |
| 416 } |
| 417 |
| 418 void TestDesktopScreenX11::SetCursorScreenPoint(const gfx::Point& point) { |
| 419 cursor_screen_point_ = point; |
| 420 } |
| 421 |
| 422 //////////////////////////////////////////////////////////////////////////////// |
408 | 423 |
409 display::Screen* CreateDesktopScreen() { | 424 display::Screen* CreateDesktopScreen() { |
410 return new DesktopScreenX11; | 425 return new DesktopScreenX11; |
411 } | 426 } |
412 | 427 |
| 428 TestDesktopScreenX11* GetTestDesktopScreenX11() { |
| 429 static std::unique_ptr<TestDesktopScreenX11> test_screen_instance; |
| 430 if (!test_screen_instance.get()) |
| 431 test_screen_instance.reset(new TestDesktopScreenX11()); |
| 432 return test_screen_instance.get(); |
| 433 } |
| 434 |
413 } // namespace views | 435 } // namespace views |
OLD | NEW |