| 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 ASH_MONITOR_MONITOR_CONTROLLER_H_ | 5 #ifndef ASH_MONITOR_MONITOR_CONTROLLER_H_ |
| 6 #define ASH_MONITOR_MONITOR_CONTROLLER_H_ | 6 #define ASH_MONITOR_MONITOR_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "ui/aura/display_observer.h" |
| 14 #include "ui/aura/monitor_manager.h" | 15 #include "ui/aura/monitor_manager.h" |
| 15 #include "ui/aura/monitor_observer.h" | |
| 16 | 16 |
| 17 namespace aura { | 17 namespace aura { |
| 18 class Monitor; | 18 class Display; |
| 19 class RootWindow; | 19 class RootWindow; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace ash { | 22 namespace ash { |
| 23 namespace internal { | 23 namespace internal { |
| 24 | 24 |
| 25 // MonitorController creates and maintains RootWindows for each | 25 // MonitorController creates and maintains RootWindows for each |
| 26 // attached monitor, keeping them in sync with monitor configuration changes. | 26 // attached monitor, keeping them in sync with monitor configuration changes. |
| 27 class MonitorController : public aura::MonitorObserver { | 27 class MonitorController : public aura::DisplayObserver { |
| 28 public: | 28 public: |
| 29 MonitorController(); | 29 MonitorController(); |
| 30 virtual ~MonitorController(); | 30 virtual ~MonitorController(); |
| 31 | 31 |
| 32 // Gets all of the root windows. | 32 // Gets all of the root windows. |
| 33 void GetAllRootWindows(std::vector<aura::RootWindow*>* windows); | 33 void GetAllRootWindows(std::vector<aura::RootWindow*>* windows); |
| 34 | 34 |
| 35 // aura::MonitorObserver overrides: | 35 // aura::DisplayObserver overrides: |
| 36 virtual void OnMonitorBoundsChanged( | 36 virtual void OnDisplayBoundsChanged( |
| 37 const gfx::Monitor& monitor) OVERRIDE; | 37 const gfx::Display& display) OVERRIDE; |
| 38 virtual void OnMonitorAdded(const gfx::Monitor& monitor) OVERRIDE; | 38 virtual void OnDisplayAdded(const gfx::Display& display) OVERRIDE; |
| 39 virtual void OnMonitorRemoved(const gfx::Monitor& monitor) OVERRIDE; | 39 virtual void OnDisplayRemoved(const gfx::Display& display) OVERRIDE; |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 void Init(); | 42 void Init(); |
| 43 | 43 |
| 44 std::map<int, aura::RootWindow*> root_windows_; | 44 std::map<int, aura::RootWindow*> root_windows_; |
| 45 | 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(MonitorController); | 46 DISALLOW_COPY_AND_ASSIGN(MonitorController); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 } // namespace internal | 49 } // namespace internal |
| 50 } // namespace ash | 50 } // namespace ash |
| 51 | 51 |
| 52 #endif // ASH_MONITOR_MONITOR_CONTROLLER_H_ | 52 #endif // ASH_MONITOR_MONITOR_CONTROLLER_H_ |
| OLD | NEW |