| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_X11_H | |
| 6 #define ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_X11_H | |
| 7 | |
| 8 #include <X11/Xlib.h> | |
| 9 | |
| 10 // Xlib.h defines RootWindow. | |
| 11 #undef RootWindow | |
| 12 | |
| 13 #include "ash/ash_export.h" | |
| 14 #include "ash/shell_observer.h" | |
| 15 #include "base/basictypes.h" | |
| 16 #include "chromeos/display/output_configurator.h" | |
| 17 | |
| 18 namespace ash { | |
| 19 namespace internal { | |
| 20 | |
| 21 // An object that observes changes in display configuration and | |
| 22 // update DisplayManagers. | |
| 23 class DisplayChangeObserverX11 | |
| 24 : public chromeos::OutputConfigurator::StateController, | |
| 25 public chromeos::OutputConfigurator::Observer, | |
| 26 public ShellObserver { | |
| 27 public: | |
| 28 DisplayChangeObserverX11(); | |
| 29 virtual ~DisplayChangeObserverX11(); | |
| 30 | |
| 31 // chromeos::OutputConfigurator::StateController overrides: | |
| 32 virtual chromeos::OutputState GetStateForDisplayIds( | |
| 33 const std::vector<int64>& outputs) const OVERRIDE; | |
| 34 virtual bool GetResolutionForDisplayId(int64 display_id, | |
| 35 int* width, | |
| 36 int* height) const OVERRIDE; | |
| 37 | |
| 38 // Overriden from chromeos::OutputConfigurator::Observer: | |
| 39 virtual void OnDisplayModeChanged( | |
| 40 const std::vector<chromeos::OutputConfigurator::OutputSnapshot>& outputs) | |
| 41 OVERRIDE; | |
| 42 | |
| 43 // Overriden from ShellObserver: | |
| 44 virtual void OnAppTerminating() OVERRIDE; | |
| 45 | |
| 46 private: | |
| 47 Display* xdisplay_; | |
| 48 | |
| 49 ::Window x_root_window_; | |
| 50 | |
| 51 int xrandr_event_base_; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(DisplayChangeObserverX11); | |
| 54 }; | |
| 55 | |
| 56 } // namespace internal | |
| 57 } // namespace ash | |
| 58 | |
| 59 #endif // ASH_DISPLAY_AURA_DISPLAY_CHANGE_OBSERVER_X11_H | |
| OLD | NEW |