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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 layout_manager_->OnWindowAddedToLayout(*it); | 284 layout_manager_->OnWindowAddedToLayout(*it); |
285 } | 285 } |
286 | 286 |
287 void Window::SetBounds(const gfx::Rect& new_bounds) { | 287 void Window::SetBounds(const gfx::Rect& new_bounds) { |
288 if (parent_ && parent_->layout_manager()) | 288 if (parent_ && parent_->layout_manager()) |
289 parent_->layout_manager()->SetChildBounds(this, new_bounds); | 289 parent_->layout_manager()->SetChildBounds(this, new_bounds); |
290 else | 290 else |
291 SetBoundsInternal(new_bounds); | 291 SetBoundsInternal(new_bounds); |
292 } | 292 } |
293 | 293 |
294 void Window::SetBoundsInScreen(const gfx::Rect& new_bounds_in_screen) { | 294 void Window::SetBoundsInScreen(const gfx::Rect& new_bounds_in_screen, |
| 295 const gfx::Display& dst_display) { |
295 RootWindow* root = GetRootWindow(); | 296 RootWindow* root = GetRootWindow(); |
296 if (root) { | 297 if (root) { |
297 gfx::Point origin = new_bounds_in_screen.origin(); | 298 gfx::Point origin = new_bounds_in_screen.origin(); |
298 aura::client::ScreenPositionClient* screen_position_client = | 299 aura::client::ScreenPositionClient* screen_position_client = |
299 aura::client::GetScreenPositionClient(root); | 300 aura::client::GetScreenPositionClient(root); |
300 screen_position_client->SetBounds(this, new_bounds_in_screen); | 301 screen_position_client->SetBounds(this, new_bounds_in_screen, dst_display); |
301 return; | 302 return; |
302 } | 303 } |
303 SetBounds(new_bounds_in_screen); | 304 SetBounds(new_bounds_in_screen); |
304 } | 305 } |
305 | 306 |
306 gfx::Rect Window::GetTargetBounds() const { | 307 gfx::Rect Window::GetTargetBounds() const { |
307 return layer_->GetTargetBounds(); | 308 return layer_->GetTargetBounds(); |
308 } | 309 } |
309 | 310 |
310 const gfx::Rect& Window::bounds() const { | 311 const gfx::Rect& Window::bounds() const { |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 for (Windows::const_reverse_iterator it = children_.rbegin(), | 942 for (Windows::const_reverse_iterator it = children_.rbegin(), |
942 rend = children_.rend(); | 943 rend = children_.rend(); |
943 it != rend; ++it) { | 944 it != rend; ++it) { |
944 Window* child = *it; | 945 Window* child = *it; |
945 child->PrintWindowHierarchy(depth + 1); | 946 child->PrintWindowHierarchy(depth + 1); |
946 } | 947 } |
947 } | 948 } |
948 #endif | 949 #endif |
949 | 950 |
950 } // namespace aura | 951 } // namespace aura |
OLD | NEW |