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