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