blob: 2cf1c1e64a089e4db3f8d6e949284475a67578af [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
15namespace gfx {
16class Display;
17class Rect;
18class Point;
19}
20
21namespace ash {
22
23class ASH_EXPORT ScreenUtil {
24 public:
25 // Finds the display that contains |point| in screeen coordinates.
26 // Returns invalid display if there is no display that can satisfy
27 // the condition.
28 static gfx::Display FindDisplayContainingPoint(const gfx::Point& point);
29
30 // Returns the bounds for maximized windows in parent coordinates.
31 // Maximized windows trigger auto-hiding the shelf.
32 static gfx::Rect GetMaximizedWindowBoundsInParent(aura::Window* window);
33
34 // Returns the display bounds in parent coordinates.
35 static gfx::Rect GetDisplayBoundsInParent(aura::Window* window);
36
37 // Returns the display's work area bounds in parent coordinates.
38 static gfx::Rect GetDisplayWorkAreaBoundsInParent(aura::Window* window);
39
oshima96f6a502015-05-02 08:43:3240 // Returns the physical display bounds containing the shelf that
41 // shares the same root window as |root|. Physical displays can
42 // differ from logical displays in unified desktop mode.
43 // TODO(oshima): If we need to expand the unified desktop support to
44 // general use, we should consider always using physical display in
45 // window layout instead of root window, and keep the logical
46 // display only in display management code.
oshimac0c9eb72015-11-04 02:16:3647 static gfx::Rect GetShelfDisplayBoundsInRoot(aura::Window* window);
oshima96f6a502015-05-02 08:43:3248
[email protected]55ad8c12014-01-17 18:24:3349 // TODO(oshima): Move following two to wm/coordinate_conversion.h
50 // Converts |rect| from |window|'s coordinates to the virtual screen
51 // coordinates.
52 static gfx::Rect ConvertRectToScreen(aura::Window* window,
53 const gfx::Rect& rect);
54
55 // Converts |rect| from virtual screen coordinates to the |window|'s
56 // coordinates.
57 static gfx::Rect ConvertRectFromScreen(aura::Window* window,
58 const gfx::Rect& rect);
59
60 // Returns a gfx::Display object for secondary display. Returns
61 // invalid display if there is no secondary display connected.
62 static const gfx::Display& GetSecondaryDisplay();
63
[email protected]24f5e242014-07-22 02:16:0964 private:
[email protected]55ad8c12014-01-17 18:24:3365 ScreenUtil() {}
66 ~ScreenUtil() {}
67
68 DISALLOW_COPY_AND_ASSIGN(ScreenUtil);
69};
70
71} // namespace ash
72
73#endif // ASH_SCREEN_UTIL_H_