| 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_TEST_SINGLE_MONITOR_MANAGER_H_ | 5 #ifndef UI_AURA_TEST_SINGLE_MONITOR_MANAGER_H_ |
| 6 #define UI_AURA_TEST_SINGLE_MONITOR_MANAGER_H_ | 6 #define UI_AURA_TEST_SINGLE_MONITOR_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "ui/aura/monitor_manager.h" | 11 #include "ui/aura/monitor_manager.h" |
| 12 #include "ui/aura/window_observer.h" | 12 #include "ui/aura/window_observer.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class Rect; | 15 class Rect; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace aura { | 18 namespace aura { |
| 19 class MonitorAura; |
| 20 |
| 19 namespace test { | 21 namespace test { |
| 20 | 22 |
| 21 // A monitor manager assuming there is one monitor. | 23 // A monitor manager assuming there is one monitor. |
| 22 class SingleMonitorManager : public MonitorManager, | 24 class SingleMonitorManager : public MonitorManager, |
| 23 public WindowObserver { | 25 public WindowObserver { |
| 24 public: | 26 public: |
| 25 SingleMonitorManager(); | 27 SingleMonitorManager(); |
| 26 virtual ~SingleMonitorManager(); | 28 virtual ~SingleMonitorManager(); |
| 27 | 29 |
| 28 // MonitorManager overrides: | 30 // MonitorManager overrides: |
| 29 virtual void OnNativeMonitorsChanged( | 31 virtual void OnNativeMonitorsChanged( |
| 30 const std::vector<const Monitor*>& monitors) OVERRIDE; | 32 const std::vector<const MonitorAura*>& monitors) OVERRIDE; |
| 31 virtual RootWindow* CreateRootWindowForMonitor( | 33 virtual RootWindow* CreateRootWindowForMonitor( |
| 32 Monitor* monitor) OVERRIDE; | 34 MonitorAura* monitor) OVERRIDE; |
| 33 virtual const Monitor* GetMonitorNearestWindow( | 35 virtual MonitorAura* GetMonitorAt(size_t index) OVERRIDE; |
| 36 |
| 37 virtual size_t GetNumMonitors() const OVERRIDE; |
| 38 |
| 39 virtual const MonitorAura* GetMonitorNearestWindow( |
| 34 const Window* window) const OVERRIDE; | 40 const Window* window) const OVERRIDE; |
| 35 virtual const Monitor* GetMonitorNearestPoint( | 41 virtual MonitorAura* GetMonitorNearestWindow(const Window* window) OVERRIDE; |
| 42 virtual const MonitorAura* GetMonitorNearestPoint( |
| 36 const gfx::Point& point) const OVERRIDE; | 43 const gfx::Point& point) const OVERRIDE; |
| 37 virtual Monitor* GetMonitorAt(size_t index) OVERRIDE; | |
| 38 virtual size_t GetNumMonitors() const OVERRIDE; | |
| 39 virtual Monitor* GetMonitorNearestWindow(const Window* window) OVERRIDE; | |
| 40 | 44 |
| 41 // WindowObserver overrides: | 45 // WindowObserver overrides: |
| 42 virtual void OnWindowBoundsChanged(Window* window, | 46 virtual void OnWindowBoundsChanged(Window* window, |
| 43 const gfx::Rect& bounds) OVERRIDE; | 47 const gfx::Rect& bounds) OVERRIDE; |
| 44 virtual void OnWindowDestroying(Window* window) OVERRIDE; | 48 virtual void OnWindowDestroying(Window* window) OVERRIDE; |
| 45 | 49 |
| 46 private: | 50 private: |
| 47 void Init(); | 51 void Init(); |
| 48 void Update(const gfx::Size size); | 52 void Update(const gfx::Size size); |
| 49 | 53 |
| 50 RootWindow* root_window_; | 54 RootWindow* root_window_; |
| 51 scoped_ptr<Monitor> monitor_; | 55 scoped_ptr<MonitorAura> monitor_; |
| 52 | 56 |
| 53 DISALLOW_COPY_AND_ASSIGN(SingleMonitorManager); | 57 DISALLOW_COPY_AND_ASSIGN(SingleMonitorManager); |
| 54 }; | 58 }; |
| 55 | 59 |
| 56 } // namespace test | 60 } // namespace test |
| 57 } // namespace aura | 61 } // namespace aura |
| 58 | 62 |
| 59 #endif // UI_AURA_TEST_SINGLE_MONITOR_MANAGER_H_ | 63 #endif // UI_AURA_TEST_SINGLE_MONITOR_MANAGER_H_ |
| OLD | NEW |