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