blob: 5e79e6c95a103dcadbfa214f497b147e2786460b [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"
[email protected]55ad8c12014-01-17 18:24:339
10namespace aura {
11class Window;
Qiang Xu07d7c9e32018-01-18 20:25:4412} // namespace aura
[email protected]55ad8c12014-01-17 18:24:3313
oshima06b39602016-05-11 02:40:1014namespace gfx {
15class Rect;
Qiang Xu07d7c9e32018-01-18 20:25:4416} // namespace gfx
oshimaf84b0da722016-04-27 19:47:1917
[email protected]55ad8c12014-01-17 18:24:3318namespace ash {
19
Qiang Xu07d7c9e32018-01-18 20:25:4420namespace screen_util {
[email protected]55ad8c12014-01-17 18:24:3321
Qiang Xu07d7c9e32018-01-18 20:25:4422// Returns the bounds for maximized windows in parent coordinates.
23// Maximized windows trigger auto-hiding the shelf.
24ASH_EXPORT gfx::Rect GetMaximizedWindowBoundsInParent(aura::Window* window);
[email protected]55ad8c12014-01-17 18:24:3325
Qiang Xu07d7c9e32018-01-18 20:25:4426// Returns the display bounds in parent coordinates.
27ASH_EXPORT gfx::Rect GetDisplayBoundsInParent(aura::Window* window);
[email protected]55ad8c12014-01-17 18:24:3328
Qiang Xu07d7c9e32018-01-18 20:25:4429// Returns the display's work area bounds in parent coordinates.
30ASH_EXPORT gfx::Rect GetDisplayWorkAreaBoundsInParent(aura::Window* window);
tbarzic98adf002017-05-26 17:28:1731
Qiang Xu07d7c9e32018-01-18 20:25:4432// Returns the display's work area bounds in parent coordinates on lock
33// screen, i.e. for work area with forced bottom alignment.
34// Note that unlike |GetDisplayWorkAreaBoundsInParent|, this method uses
35// work area bounds that are updated when the screen is locked. For example
36// if shelf alignment is set to right before screen lock,
37// |GetDisplayWorkAreaBoundsInParent| will return work are bounds for right
38// shelf alignment - this method will return work area for bottom shelf
39// alignment (which is always used on lock screen).
40ASH_EXPORT gfx::Rect GetDisplayWorkAreaBoundsInParentForLockScreen(
41 aura::Window* window);
[email protected]55ad8c12014-01-17 18:24:3342
Qiang Xu07d7c9e32018-01-18 20:25:4443// Returns the bounds of the physical display containing the shelf for
44// |window|. Physical displays can differ from logical displays in unified
45// desktop mode.
46// TODO(oshima): Consider using physical displays in window layout, instead of
47// root windows, and only use logical display in display management code.
48ASH_EXPORT gfx::Rect GetDisplayBoundsWithShelf(aura::Window* window);
49
Malay Keshavfd6fd0c2018-07-31 22:07:4750// Returns an adjusted bounds for the given |bounds| by false snapping it to the
51// edge of the display in pixel space. It will snap the bounds to the display
52// that contains |window|. This will prevent any 1px gaps that you might see at
53// the edges of the display. We achieve this by increasing the height and/or the
54// width of |bounds| so that in pixel space, they cover the edge of the dispaly.
55// |bounds| should be in screen space.
56ASH_EXPORT gfx::Rect SnapBoundsToDisplayEdge(const gfx::Rect& bounds,
57 const aura::Window* window);
58
Qiang Xu07d7c9e32018-01-18 20:25:4459} // namespace screen_util
[email protected]55ad8c12014-01-17 18:24:3360
61} // namespace ash
62
63#endif // ASH_SCREEN_UTIL_H_