Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Unified Diff: ui/views/corewm/screen_util.cc

Issue 11574041: Move WindowResizer to CoreWM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/corewm/screen_util.h ('k') | ui/views/corewm/window_resizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/views/corewm/screen_util.h ('k') | ui/views/corewm/window_resizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698