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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. | 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. |
6 | 6 |
7 #include "ui/views/view.h" | 7 #include "ui/views/view.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 DestroyLayer(); | 528 DestroyLayer(); |
529 } | 529 } |
530 } | 530 } |
531 | 531 |
532 ui::Layer* View::RecreateLayer() { | 532 ui::Layer* View::RecreateLayer() { |
533 ui::Layer* layer = AcquireLayer(); | 533 ui::Layer* layer = AcquireLayer(); |
534 if (!layer) | 534 if (!layer) |
535 return NULL; | 535 return NULL; |
536 | 536 |
537 CreateLayer(); | 537 CreateLayer(); |
| 538 |
| 539 // TODO(pkotwicz): Remove this once ReorderLayers() stacks layers not attached |
| 540 // to a view above layers attached to a view. |
| 541 if (layer->parent()) |
| 542 layer->parent()->StackAtTop(layer); |
| 543 |
538 layer_->set_scale_content(layer->scale_content()); | 544 layer_->set_scale_content(layer->scale_content()); |
539 return layer; | 545 return layer; |
540 } | 546 } |
541 | 547 |
542 // RTL positioning ------------------------------------------------------------- | 548 // RTL positioning ------------------------------------------------------------- |
543 | 549 |
544 gfx::Rect View::GetMirroredBounds() const { | 550 gfx::Rect View::GetMirroredBounds() const { |
545 gfx::Rect bounds(bounds_); | 551 gfx::Rect bounds(bounds_); |
546 bounds.set_x(GetMirroredX()); | 552 bounds.set_x(GetMirroredX()); |
547 return bounds; | 553 return bounds; |
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2293 ConvertPointToWidget(this, &widget_location); | 2299 ConvertPointToWidget(this, &widget_location); |
2294 GetWidget()->RunShellDrag(this, data, widget_location, drag_operations, | 2300 GetWidget()->RunShellDrag(this, data, widget_location, drag_operations, |
2295 source); | 2301 source); |
2296 return true; | 2302 return true; |
2297 #else | 2303 #else |
2298 return false; | 2304 return false; |
2299 #endif // !defined(OS_MACOSX) | 2305 #endif // !defined(OS_MACOSX) |
2300 } | 2306 } |
2301 | 2307 |
2302 } // namespace views | 2308 } // namespace views |
OLD | NEW |