| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 ASH_SCREEN_UTIL_H_ | 5 #ifndef ASH_SCREEN_UTIL_H_ |
| 6 #define ASH_SCREEN_UTIL_H_ | 6 #define ASH_SCREEN_UTIL_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 | 10 |
| 11 namespace aura { | 11 namespace aura { |
| 12 class Window; | 12 class Window; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace gfx { | 15 namespace gfx { |
| 16 class Display; | 16 class Display; |
| 17 class Rect; | 17 class Rect; |
| 18 class Point; | 18 class Point; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace display { |
| 22 using Display = gfx::Display; |
| 23 } |
| 24 |
| 21 namespace ash { | 25 namespace ash { |
| 22 | 26 |
| 23 class ASH_EXPORT ScreenUtil { | 27 class ASH_EXPORT ScreenUtil { |
| 24 public: | 28 public: |
| 25 // Finds the display that contains |point| in screeen coordinates. | 29 // Finds the display that contains |point| in screeen coordinates. |
| 26 // Returns invalid display if there is no display that can satisfy | 30 // Returns invalid display if there is no display that can satisfy |
| 27 // the condition. | 31 // the condition. |
| 28 static gfx::Display FindDisplayContainingPoint(const gfx::Point& point); | 32 static display::Display FindDisplayContainingPoint(const gfx::Point& point); |
| 29 | 33 |
| 30 // Returns the bounds for maximized windows in parent coordinates. | 34 // Returns the bounds for maximized windows in parent coordinates. |
| 31 // Maximized windows trigger auto-hiding the shelf. | 35 // Maximized windows trigger auto-hiding the shelf. |
| 32 static gfx::Rect GetMaximizedWindowBoundsInParent(aura::Window* window); | 36 static gfx::Rect GetMaximizedWindowBoundsInParent(aura::Window* window); |
| 33 | 37 |
| 34 // Returns the display bounds in parent coordinates. | 38 // Returns the display bounds in parent coordinates. |
| 35 static gfx::Rect GetDisplayBoundsInParent(aura::Window* window); | 39 static gfx::Rect GetDisplayBoundsInParent(aura::Window* window); |
| 36 | 40 |
| 37 // Returns the display's work area bounds in parent coordinates. | 41 // Returns the display's work area bounds in parent coordinates. |
| 38 static gfx::Rect GetDisplayWorkAreaBoundsInParent(aura::Window* window); | 42 static gfx::Rect GetDisplayWorkAreaBoundsInParent(aura::Window* window); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 50 // Converts |rect| from |window|'s coordinates to the virtual screen | 54 // Converts |rect| from |window|'s coordinates to the virtual screen |
| 51 // coordinates. | 55 // coordinates. |
| 52 static gfx::Rect ConvertRectToScreen(aura::Window* window, | 56 static gfx::Rect ConvertRectToScreen(aura::Window* window, |
| 53 const gfx::Rect& rect); | 57 const gfx::Rect& rect); |
| 54 | 58 |
| 55 // Converts |rect| from virtual screen coordinates to the |window|'s | 59 // Converts |rect| from virtual screen coordinates to the |window|'s |
| 56 // coordinates. | 60 // coordinates. |
| 57 static gfx::Rect ConvertRectFromScreen(aura::Window* window, | 61 static gfx::Rect ConvertRectFromScreen(aura::Window* window, |
| 58 const gfx::Rect& rect); | 62 const gfx::Rect& rect); |
| 59 | 63 |
| 60 // Returns a gfx::Display object for secondary display. Returns | 64 // Returns a display::Display object for secondary display. Returns |
| 61 // invalid display if there is no secondary display connected. | 65 // invalid display if there is no secondary display connected. |
| 62 static const gfx::Display& GetSecondaryDisplay(); | 66 static const display::Display& GetSecondaryDisplay(); |
| 63 | 67 |
| 64 private: | 68 private: |
| 65 ScreenUtil() {} | 69 ScreenUtil() {} |
| 66 ~ScreenUtil() {} | 70 ~ScreenUtil() {} |
| 67 | 71 |
| 68 DISALLOW_COPY_AND_ASSIGN(ScreenUtil); | 72 DISALLOW_COPY_AND_ASSIGN(ScreenUtil); |
| 69 }; | 73 }; |
| 70 | 74 |
| 71 } // namespace ash | 75 } // namespace ash |
| 72 | 76 |
| 73 #endif // ASH_SCREEN_UTIL_H_ | 77 #endif // ASH_SCREEN_UTIL_H_ |
| OLD | NEW |