OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/aura/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 else | 291 else |
292 SetBoundsInternal(new_bounds); | 292 SetBoundsInternal(new_bounds); |
293 } | 293 } |
294 | 294 |
295 void Window::SetBoundsInScreen(const gfx::Rect& new_bounds_in_screen) { | 295 void Window::SetBoundsInScreen(const gfx::Rect& new_bounds_in_screen) { |
296 RootWindow* root = GetRootWindow(); | 296 RootWindow* root = GetRootWindow(); |
297 if (root) { | 297 if (root) { |
298 gfx::Point origin = new_bounds_in_screen.origin(); | 298 gfx::Point origin = new_bounds_in_screen.origin(); |
299 aura::client::ScreenPositionClient* screen_position_client = | 299 aura::client::ScreenPositionClient* screen_position_client = |
300 aura::client::GetScreenPositionClient(root); | 300 aura::client::GetScreenPositionClient(root); |
301 screen_position_client->ConvertPointFromScreen( | 301 screen_position_client->SetBounds(this, new_bounds_in_screen); |
302 parent(), &origin); | |
303 SetBounds(gfx::Rect(origin, new_bounds_in_screen.size())); | |
304 return; | 302 return; |
305 } | 303 } |
306 SetBounds(new_bounds_in_screen); | 304 SetBounds(new_bounds_in_screen); |
307 } | 305 } |
308 | 306 |
309 gfx::Rect Window::GetTargetBounds() const { | 307 gfx::Rect Window::GetTargetBounds() const { |
310 return layer_->GetTargetBounds(); | 308 return layer_->GetTargetBounds(); |
311 } | 309 } |
312 | 310 |
313 const gfx::Rect& Window::bounds() const { | 311 const gfx::Rect& Window::bounds() const { |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 for (Windows::const_reverse_iterator it = children_.rbegin(), | 945 for (Windows::const_reverse_iterator it = children_.rbegin(), |
948 rend = children_.rend(); | 946 rend = children_.rend(); |
949 it != rend; ++it) { | 947 it != rend; ++it) { |
950 Window* child = *it; | 948 Window* child = *it; |
951 child->PrintWindowHierarchy(depth + 1); | 949 child->PrintWindowHierarchy(depth + 1); |
952 } | 950 } |
953 } | 951 } |
954 #endif | 952 #endif |
955 | 953 |
956 } // namespace aura | 954 } // namespace aura |
OLD | NEW |