| Index: ash/wm/common/wm_screen_util.cc
|
| diff --git a/ash/wm/common/wm_screen_util.cc b/ash/wm/common/wm_screen_util.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..dc96aa75fc0361d592782ca3b2826994d1e00f02
|
| --- /dev/null
|
| +++ b/ash/wm/common/wm_screen_util.cc
|
| @@ -0,0 +1,32 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "ash/wm/common/wm_screen_util.h"
|
| +
|
| +#include "ash/wm/common/wm_root_window_controller.h"
|
| +#include "ash/wm/common/wm_window.h"
|
| +#include "ui/gfx/display.h"
|
| +
|
| +namespace ash {
|
| +namespace wm {
|
| +
|
| +gfx::Rect GetDisplayWorkAreaBoundsInParent(WmWindow* window) {
|
| + gfx::Display display = window->GetDisplayNearestWindow();
|
| + return window->GetParent()->ConvertRectFromScreen(display.work_area());
|
| +}
|
| +
|
| +gfx::Rect GetDisplayBoundsInParent(WmWindow* window) {
|
| + gfx::Display display = window->GetDisplayNearestWindow();
|
| + return window->GetParent()->ConvertRectFromScreen(display.bounds());
|
| +}
|
| +
|
| +gfx::Rect GetMaximizedWindowBoundsInParent(WmWindow* window) {
|
| + if (window->GetRootWindowController()->HasShelf())
|
| + return GetDisplayWorkAreaBoundsInParent(window);
|
| +
|
| + return GetDisplayBoundsInParent(window);
|
| +}
|
| +
|
| +} // namespace wm
|
| +} // namespace ash
|
|
|