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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 SetBoundsInternal(final_bounds); | 306 SetBoundsInternal(final_bounds); |
307 } | 307 } |
308 } | 308 } |
309 | 309 |
310 void Window::SetBoundsInScreen(const gfx::Rect& new_bounds_in_screen, | 310 void Window::SetBoundsInScreen(const gfx::Rect& new_bounds_in_screen, |
311 const display::Display& dst_display) { | 311 const display::Display& dst_display) { |
312 Window* root = GetRootWindow(); | 312 Window* root = GetRootWindow(); |
313 if (root) { | 313 if (root) { |
314 aura::client::ScreenPositionClient* screen_position_client = | 314 aura::client::ScreenPositionClient* screen_position_client = |
315 aura::client::GetScreenPositionClient(root); | 315 aura::client::GetScreenPositionClient(root); |
316 screen_position_client->SetBounds(this, new_bounds_in_screen, dst_display); | 316 if (screen_position_client) { |
317 return; | 317 screen_position_client->SetBounds(this, new_bounds_in_screen, |
| 318 dst_display); |
| 319 return; |
| 320 } |
318 } | 321 } |
319 SetBounds(new_bounds_in_screen); | 322 SetBounds(new_bounds_in_screen); |
320 } | 323 } |
321 | 324 |
322 gfx::Rect Window::GetTargetBounds() const { | 325 gfx::Rect Window::GetTargetBounds() const { |
323 return layer() ? layer()->GetTargetBounds() : bounds(); | 326 return layer() ? layer()->GetTargetBounds() : bounds(); |
324 } | 327 } |
325 | 328 |
326 void Window::SchedulePaintInRect(const gfx::Rect& rect) { | 329 void Window::SchedulePaintInRect(const gfx::Rect& rect) { |
327 layer()->SchedulePaint(rect); | 330 layer()->SchedulePaint(rect); |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 layer_name = "Unnamed Window"; | 1118 layer_name = "Unnamed Window"; |
1116 | 1119 |
1117 if (id_ != -1) | 1120 if (id_ != -1) |
1118 layer_name += " " + base::IntToString(id_); | 1121 layer_name += " " + base::IntToString(id_); |
1119 | 1122 |
1120 layer()->set_name(layer_name); | 1123 layer()->set_name(layer_name); |
1121 #endif | 1124 #endif |
1122 } | 1125 } |
1123 | 1126 |
1124 } // namespace aura | 1127 } // namespace aura |
OLD | NEW |