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

Unified Diff: ui/views/widget/desktop_screen_position_client.cc

Issue 11369220: Move the desktop aura classes into a desktop subdir to make the gyp simpler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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/widget/desktop_screen_position_client.h ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_screen_position_client.cc
===================================================================
--- ui/views/widget/desktop_screen_position_client.cc (revision 167419)
+++ ui/views/widget/desktop_screen_position_client.cc (working copy)
@@ -1,70 +0,0 @@
-// 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/widget/desktop_screen_position_client.h"
-
-#include "ui/aura/root_window.h"
-#include "ui/views/widget/desktop_native_widget_aura.h"
-
-namespace views {
-
-DesktopScreenPositionClient::DesktopScreenPositionClient() {
-}
-
-DesktopScreenPositionClient::~DesktopScreenPositionClient() {
-}
-
-void DesktopScreenPositionClient::ConvertPointToScreen(
- const aura::Window* window, gfx::Point* point) {
- const aura::RootWindow* root_window = window->GetRootWindow();
- aura::Window::ConvertPointToTarget(window, root_window, point);
- gfx::Point origin = root_window->GetHostOrigin();
- point->Offset(origin.x(), origin.y());
-}
-
-void DesktopScreenPositionClient::ConvertPointFromScreen(
- const aura::Window* window, gfx::Point* point) {
- const aura::RootWindow* root_window = window->GetRootWindow();
- gfx::Point origin = root_window->GetHostOrigin();
- point->Offset(-origin.x(), -origin.y());
- aura::Window::ConvertPointToTarget(root_window, window, point);
-}
-
-void DesktopScreenPositionClient::ConvertNativePointToScreen(
- aura::Window* window, gfx::Point* point) {
- ConvertPointToScreen(window, point);
-}
-
-void DesktopScreenPositionClient::SetBounds(
- aura::Window* window,
- const gfx::Rect& bounds,
- const gfx::Display& display) {
- // TODO: Use the 3rd parameter, |display|.
- gfx::Point origin = bounds.origin();
- aura::RootWindow* root = window->GetRootWindow();
- aura::Window::ConvertPointToTarget(window->parent(), root, &origin);
-
- if (window->type() == aura::client::WINDOW_TYPE_CONTROL) {
- window->SetBounds(gfx::Rect(origin, bounds.size()));
- return;
- } else if (window->type() == aura::client::WINDOW_TYPE_POPUP) {
- // The caller expects windows we consider "embedded" to be placed in the
- // screen coordinate system. So we need to offset the root window's
- // position (which is in screen coordinates) from these bounds.
- gfx::Point host_origin = root->GetHostOrigin();
- origin.Offset(-host_origin.x(), -host_origin.y());
- window->SetBounds(gfx::Rect(origin, bounds.size()));
- return;
- }
- DesktopNativeWidgetAura* desktop_native_widget =
- DesktopNativeWidgetAura::ForWindow(window);
- if (desktop_native_widget) {
- root->SetHostBounds(bounds);
- // Setting bounds of root resizes |window|.
- } else {
- window->SetBounds(bounds);
- }
-}
-
-} // namespace views
« no previous file with comments | « ui/views/widget/desktop_screen_position_client.h ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698