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_delegate_x11.h" | 5 #include "ui/display/chromeos/x11/native_display_delegate_x11.h" |
6 | 6 |
7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 #include <X11/extensions/dpms.h> | 9 #include <X11/extensions/dpms.h> |
10 #include <X11/extensions/Xrandr.h> | 10 #include <X11/extensions/Xrandr.h> |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 } // namespace | 73 } // namespace |
74 | 74 |
75 //////////////////////////////////////////////////////////////////////////////// | 75 //////////////////////////////////////////////////////////////////////////////// |
76 // NativeDisplayDelegateX11::HelperDelegateX11 | 76 // NativeDisplayDelegateX11::HelperDelegateX11 |
77 | 77 |
78 class NativeDisplayDelegateX11::HelperDelegateX11 | 78 class NativeDisplayDelegateX11::HelperDelegateX11 |
79 : public NativeDisplayDelegateX11::HelperDelegate { | 79 : public NativeDisplayDelegateX11::HelperDelegate { |
80 public: | 80 public: |
81 HelperDelegateX11(NativeDisplayDelegateX11* delegate) : delegate_(delegate) {} | 81 HelperDelegateX11(NativeDisplayDelegateX11* delegate) : delegate_(delegate) {} |
82 virtual ~HelperDelegateX11() {} | 82 ~HelperDelegateX11() override {} |
83 | 83 |
84 // NativeDisplayDelegateX11::HelperDelegate overrides: | 84 // NativeDisplayDelegateX11::HelperDelegate overrides: |
85 virtual void UpdateXRandRConfiguration(const base::NativeEvent& event) | 85 void UpdateXRandRConfiguration(const base::NativeEvent& event) override { |
86 override { | |
87 XRRUpdateConfiguration(event); | 86 XRRUpdateConfiguration(event); |
88 } | 87 } |
89 virtual const std::vector<DisplaySnapshot*>& GetCachedDisplays() const | 88 const std::vector<DisplaySnapshot*>& GetCachedDisplays() const override { |
90 override { | |
91 return delegate_->cached_outputs_.get(); | 89 return delegate_->cached_outputs_.get(); |
92 } | 90 } |
93 virtual void NotifyDisplayObservers() override { | 91 void NotifyDisplayObservers() override { |
94 FOR_EACH_OBSERVER( | 92 FOR_EACH_OBSERVER( |
95 NativeDisplayObserver, delegate_->observers_, OnConfigurationChanged()); | 93 NativeDisplayObserver, delegate_->observers_, OnConfigurationChanged()); |
96 } | 94 } |
97 | 95 |
98 private: | 96 private: |
99 NativeDisplayDelegateX11* delegate_; | 97 NativeDisplayDelegateX11* delegate_; |
100 | 98 |
101 DISALLOW_COPY_AND_ASSIGN(HelperDelegateX11); | 99 DISALLOW_COPY_AND_ASSIGN(HelperDelegateX11); |
102 }; | 100 }; |
103 | 101 |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 XSetForeground(display_, gc, color.pixel); | 640 XSetForeground(display_, gc, color.pixel); |
643 XSetFillStyle(display_, gc, FillSolid); | 641 XSetFillStyle(display_, gc, FillSolid); |
644 int width = DisplayWidth(display_, DefaultScreen(display_)); | 642 int width = DisplayWidth(display_, DefaultScreen(display_)); |
645 int height = DisplayHeight(display_, DefaultScreen(display_)); | 643 int height = DisplayHeight(display_, DefaultScreen(display_)); |
646 XFillRectangle(display_, window_, gc, 0, 0, width, height); | 644 XFillRectangle(display_, window_, gc, 0, 0, width, height); |
647 XFreeGC(display_, gc); | 645 XFreeGC(display_, gc); |
648 XFreeColors(display_, colormap, &color.pixel, 1, 0); | 646 XFreeColors(display_, colormap, &color.pixel, 1, 0); |
649 } | 647 } |
650 | 648 |
651 } // namespace ui | 649 } // namespace ui |
OLD | NEW |