| Index: ui/views/corewm/screen_util.cc
|
| ===================================================================
|
| --- ui/views/corewm/screen_util.cc (revision 0)
|
| +++ ui/views/corewm/screen_util.cc (revision 0)
|
| @@ -0,0 +1,38 @@
|
| +// Copyright (c) 2012 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 "ui/views/corewm/screen_util.h"
|
| +
|
| +#include "ui/aura/client/screen_position_client.h"
|
| +#include "ui/aura/root_window.h"
|
| +#include "ui/aura/window.h"
|
| +#include "ui/gfx/screen.h"
|
| +
|
| +namespace views {
|
| +namespace corewm {
|
| +
|
| +gfx::Rect GetDisplayWorkAreaBoundsInParent(aura::Window* window) {
|
| + return ConvertRectFromScreen(
|
| + window->parent(),
|
| + gfx::Screen::GetScreenFor(window)->GetDisplayNearestWindow(
|
| + window).work_area());
|
| +}
|
| +
|
| +// static
|
| +gfx::Rect ConvertRectToScreen(aura::Window* window, const gfx::Rect& rect) {
|
| + gfx::Point point = rect.origin();
|
| + aura::client::GetScreenPositionClient(window->GetRootWindow())->
|
| + ConvertPointToScreen(window, &point);
|
| + return gfx::Rect(point, rect.size());
|
| +}
|
| +
|
| +gfx::Rect ConvertRectFromScreen(aura::Window* window, const gfx::Rect& rect) {
|
| + gfx::Point point = rect.origin();
|
| + aura::client::GetScreenPositionClient(window->GetRootWindow())->
|
| + ConvertPointFromScreen(window, &point);
|
| + return gfx::Rect(point, rect.size());
|
| +}
|
| +
|
| +} // namespace corewm
|
| +} // namespace views
|
|
|