blob: 853c12e83763d794ab2ad33f306db628bb9d253b [file] [log] [blame]
[email protected]55ad8c12014-01-17 18:24:331// Copyright 2014 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_SCREEN_UTIL_H_
6#define ASH_SCREEN_UTIL_H_
7
8#include "ash/ash_export.h"
avidb567a8a2015-12-20 17:07:249#include "base/macros.h"
[email protected]55ad8c12014-01-17 18:24:3310
11namespace aura {
12class Window;
13}
14
oshima06b39602016-05-11 02:40:1015namespace display {
[email protected]55ad8c12014-01-17 18:24:3316class Display;
[email protected]55ad8c12014-01-17 18:24:3317}
18
oshima06b39602016-05-11 02:40:1019namespace gfx {
20class Rect;
21class Point;
oshimaf84b0da722016-04-27 19:47:1922}
23
[email protected]55ad8c12014-01-17 18:24:3324namespace ash {
25
26class ASH_EXPORT ScreenUtil {
27 public:
28 // Finds the display that contains |point| in screeen coordinates.
29 // Returns invalid display if there is no display that can satisfy
30 // the condition.
oshimaf84b0da722016-04-27 19:47:1931 static display::Display FindDisplayContainingPoint(const gfx::Point& point);
[email protected]55ad8c12014-01-17 18:24:3332
33 // Returns the bounds for maximized windows in parent coordinates.
34 // Maximized windows trigger auto-hiding the shelf.
35 static gfx::Rect GetMaximizedWindowBoundsInParent(aura::Window* window);
36
37 // Returns the display bounds in parent coordinates.
38 static gfx::Rect GetDisplayBoundsInParent(aura::Window* window);
39
40 // Returns the display's work area bounds in parent coordinates.
41 static gfx::Rect GetDisplayWorkAreaBoundsInParent(aura::Window* window);
42
oshima96f6a502015-05-02 08:43:3243 // Returns the physical display bounds containing the shelf that
44 // shares the same root window as |root|. Physical displays can
45 // differ from logical displays in unified desktop mode.
46 // TODO(oshima): If we need to expand the unified desktop support to
47 // general use, we should consider always using physical display in
48 // window layout instead of root window, and keep the logical
49 // display only in display management code.
oshimac0c9eb72015-11-04 02:16:3650 static gfx::Rect GetShelfDisplayBoundsInRoot(aura::Window* window);
oshima96f6a502015-05-02 08:43:3251
[email protected]55ad8c12014-01-17 18:24:3352 // TODO(oshima): Move following two to wm/coordinate_conversion.h
53 // Converts |rect| from |window|'s coordinates to the virtual screen
54 // coordinates.
55 static gfx::Rect ConvertRectToScreen(aura::Window* window,
56 const gfx::Rect& rect);
57
58 // Converts |rect| from virtual screen coordinates to the |window|'s
59 // coordinates.
60 static gfx::Rect ConvertRectFromScreen(aura::Window* window,
61 const gfx::Rect& rect);
62
oshimaf84b0da722016-04-27 19:47:1963 // Returns a display::Display object for secondary display. Returns
[email protected]55ad8c12014-01-17 18:24:3364 // invalid display if there is no secondary display connected.
oshimaf84b0da722016-04-27 19:47:1965 static const display::Display& GetSecondaryDisplay();
[email protected]55ad8c12014-01-17 18:24:3366
[email protected]24f5e242014-07-22 02:16:0967 private:
[email protected]55ad8c12014-01-17 18:24:3368 ScreenUtil() {}
69 ~ScreenUtil() {}
70
71 DISALLOW_COPY_AND_ASSIGN(ScreenUtil);
72};
73
74} // namespace ash
75
76#endif // ASH_SCREEN_UTIL_H_