| 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_SINGLE_MONITOR_MANAGER_H_ | 5 #ifndef UI_AURA_SINGLE_DISPLAY_MANAGER_H_ |
| 6 #define UI_AURA_SINGLE_MONITOR_MANAGER_H_ | 6 #define UI_AURA_SINGLE_DISPLAY_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "ui/aura/aura_export.h" | 10 #include "ui/aura/aura_export.h" |
| 11 #include "ui/aura/monitor_manager.h" | 11 #include "ui/aura/display_manager.h" |
| 12 #include "ui/aura/window_observer.h" | 12 #include "ui/aura/window_observer.h" |
| 13 #include "ui/gfx/display.h" | 13 #include "ui/gfx/display.h" |
| 14 | 14 |
| 15 namespace gfx { | 15 namespace gfx { |
| 16 class Rect; | 16 class Rect; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace aura { | 19 namespace aura { |
| 20 | 20 |
| 21 // A monitor manager assuming there is one monitor. | 21 // A display manager assuming there is one display. |
| 22 class AURA_EXPORT SingleMonitorManager : public MonitorManager, | 22 class AURA_EXPORT SingleDisplayManager : public DisplayManager, |
| 23 public WindowObserver { | 23 public WindowObserver { |
| 24 public: | 24 public: |
| 25 SingleMonitorManager(); | 25 SingleDisplayManager(); |
| 26 virtual ~SingleMonitorManager(); | 26 virtual ~SingleDisplayManager(); |
| 27 | 27 |
| 28 // MonitorManager overrides: | 28 // DisplayManager overrides: |
| 29 virtual void OnNativeMonitorsChanged( | 29 virtual void OnNativeDisplaysChanged( |
| 30 const std::vector<gfx::Display>& display) OVERRIDE; | 30 const std::vector<gfx::Display>& display) OVERRIDE; |
| 31 virtual RootWindow* CreateRootWindowForMonitor( | 31 virtual RootWindow* CreateRootWindowForDisplay( |
| 32 const gfx::Display& display) OVERRIDE; | 32 const gfx::Display& display) OVERRIDE; |
| 33 virtual const gfx::Display& GetDisplayAt(size_t index) OVERRIDE; | 33 virtual const gfx::Display& GetDisplayAt(size_t index) OVERRIDE; |
| 34 | 34 |
| 35 virtual size_t GetNumDisplays() const OVERRIDE; | 35 virtual size_t GetNumDisplays() const OVERRIDE; |
| 36 | 36 |
| 37 virtual const gfx::Display& GetDisplayNearestWindow( | 37 virtual const gfx::Display& GetDisplayNearestWindow( |
| 38 const Window* window) const OVERRIDE; | 38 const Window* window) const OVERRIDE; |
| 39 virtual const gfx::Display& GetDisplayNearestPoint( | 39 virtual const gfx::Display& GetDisplayNearestPoint( |
| 40 const gfx::Point& point) const OVERRIDE; | 40 const gfx::Point& point) const OVERRIDE; |
| 41 | 41 |
| 42 // WindowObserver overrides: | 42 // WindowObserver overrides: |
| 43 virtual void OnWindowBoundsChanged(Window* window, | 43 virtual void OnWindowBoundsChanged(Window* window, |
| 44 const gfx::Rect& old_bounds, | 44 const gfx::Rect& old_bounds, |
| 45 const gfx::Rect& new_bounds) OVERRIDE; | 45 const gfx::Rect& new_bounds) OVERRIDE; |
| 46 virtual void OnWindowDestroying(Window* window) OVERRIDE; | 46 virtual void OnWindowDestroying(Window* window) OVERRIDE; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 void Init(); | 49 void Init(); |
| 50 void Update(const gfx::Size size); | 50 void Update(const gfx::Size size); |
| 51 | 51 |
| 52 RootWindow* root_window_; | 52 RootWindow* root_window_; |
| 53 gfx::Display display_; | 53 gfx::Display display_; |
| 54 | 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(SingleMonitorManager); | 55 DISALLOW_COPY_AND_ASSIGN(SingleDisplayManager); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 } // namespace aura | 58 } // namespace aura |
| 59 | 59 |
| 60 #endif // UI_AURA_SINGLE_MONITOR_MANAGER_H_ | 60 #endif // UI_AURA_SINGLE_DISPLAY_MANAGER_H_ |
| OLD | NEW |