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_MONITOR_MULTI_MONITOR_MANAGER_H_ |
| 6 #define ASH_MONITOR_MULTI_MONITOR_MANAGER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "ui/aura/monitor_manager.h" |
| 12 #include "ui/aura/window.h" |
| 13 #include "ui/aura/window_observer.h" |
| 14 |
| 15 namespace ash { |
| 16 namespace internal { |
| 17 |
| 18 class MultiMonitorManager : public aura::MonitorManager, |
| 19 public aura::WindowObserver { |
| 20 public: |
| 21 MultiMonitorManager(); |
| 22 virtual ~MultiMonitorManager(); |
| 23 |
| 24 // MonitorManager overrides: |
| 25 virtual void OnNativeMonitorResized(const gfx::Size& size) OVERRIDE; |
| 26 virtual aura::RootWindow* CreateRootWindowForMonitor( |
| 27 aura::Monitor* monitor) OVERRIDE; |
| 28 virtual const aura::Monitor* GetMonitorNearestWindow( |
| 29 const aura::Window* window) const OVERRIDE; |
| 30 virtual const aura::Monitor* GetMonitorNearestPoint( |
| 31 const gfx::Point& point) const OVERRIDE; |
| 32 virtual aura::Monitor* GetMonitorAt(size_t index) OVERRIDE; |
| 33 virtual size_t GetNumMonitors() const OVERRIDE; |
| 34 virtual aura::Monitor* GetMonitorNearestWindow( |
| 35 const aura::Window* window) OVERRIDE; |
| 36 |
| 37 // WindowObserver overrides: |
| 38 virtual void OnWindowBoundsChanged(aura::Window* window, |
| 39 const gfx::Rect& bounds) OVERRIDE; |
| 40 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
| 41 |
| 42 private: |
| 43 typedef std::vector<aura::Monitor*> Monitors; |
| 44 |
| 45 void Init(); |
| 46 |
| 47 Monitors monitors_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(MultiMonitorManager); |
| 50 }; |
| 51 |
| 52 extern const aura::WindowProperty<aura::Monitor*>* const kMonitorKey; |
| 53 |
| 54 } // namespace internal |
| 55 } // namespace ash |
| 56 |
| 57 #endif // ASH_MONITOR_MULTI_MONITOR_MANAGER_H_ |
OLD | NEW |