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

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

Issue 21504003: Don't assume that widgets of TYPE_CONTROL are parented to the RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix review issues. Created 7 years, 4 months 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 | « no previous file | ui/views/widget/desktop_aura/desktop_screen_position_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_screen_position_client.cc
diff --git a/ui/views/widget/desktop_aura/desktop_screen_position_client.cc b/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
index 12be4ccc97cfd0fdb3e96e4bc5630fa577aad1f6..2ca556c39794c521f974bdb14741f0ad4b788f1e 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
@@ -68,19 +68,16 @@ void DesktopScreenPositionClient::SetBounds(
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;
- }
if (PositionWindowInScreenCoordinates(window)) {
// 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 origin = bounds.origin();
+ aura::Window::ConvertPointToTarget(window->parent(), root, &origin);
+
gfx::Point host_origin = GetOrigin(root);
origin.Offset(-host_origin.x(), -host_origin.y());
window->SetBounds(gfx::Rect(origin, bounds.size()));
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_screen_position_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698