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 #ifndef UI_AURA_MONITOR_CHANGE_OBSERVER_X11_H | 5 #ifndef UI_AURA_DISPLAY_CHANGE_OBSERVER_X11_H |
6 #define UI_AURA_MONITOR_CHANGE_OBSERVER_X11_H | 6 #define UI_AURA_DISPLAY_CHANGE_OBSERVER_X11_H |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 | 10 |
11 // Xlib.h defines RootWindow. | 11 // Xlib.h defines RootWindow. |
12 #undef RootWindow | 12 #undef RootWindow |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
16 | 16 |
17 namespace aura { | 17 namespace aura { |
18 namespace internal { | 18 namespace internal { |
19 | 19 |
20 // An object that observes changes in monitor configuration and | 20 // An object that observes changes in display configuration and |
21 // update MonitorManagers. | 21 // update DisplayManagers. |
22 class MonitorChangeObserverX11 : public MessageLoop::Dispatcher { | 22 class DisplayChangeObserverX11 : public MessageLoop::Dispatcher { |
23 public: | 23 public: |
24 MonitorChangeObserverX11(); | 24 DisplayChangeObserverX11(); |
25 virtual ~MonitorChangeObserverX11(); | 25 virtual ~DisplayChangeObserverX11(); |
26 | 26 |
27 // Overridden from Dispatcher overrides: | 27 // Overridden from Dispatcher overrides: |
28 virtual bool Dispatch(const base::NativeEvent& xev) OVERRIDE; | 28 virtual bool Dispatch(const base::NativeEvent& xev) OVERRIDE; |
29 | 29 |
30 // Reads display configurations from the system and notifies | 30 // Reads display configurations from the system and notifies |
31 // |monitor_manager_| about the change. | 31 // |display_manager_| about the change. |
32 void NotifyDisplayChange(); | 32 void NotifyDisplayChange(); |
33 | 33 |
34 private: | 34 private: |
35 Display* xdisplay_; | 35 Display* xdisplay_; |
36 | 36 |
37 ::Window x_root_window_; | 37 ::Window x_root_window_; |
38 | 38 |
39 int xrandr_event_base_; | 39 int xrandr_event_base_; |
40 | 40 |
41 DISALLOW_COPY_AND_ASSIGN(MonitorChangeObserverX11); | 41 DISALLOW_COPY_AND_ASSIGN(DisplayChangeObserverX11); |
42 }; | 42 }; |
43 | 43 |
44 } // namespace internal | 44 } // namespace internal |
45 } // namespace aura | 45 } // namespace aura |
46 | 46 |
47 #endif // UI_AURA_MONITOR_CHANGE_OBSERVER_X11_H | 47 #endif // UI_AURA_DISPLAY_CHANGE_OBSERVER_X11_H |
OLD | NEW |