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 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1555 } | 1555 } |
1556 | 1556 |
1557 void View::ReorderChildLayers(ui::Layer* parent_layer) { | 1557 void View::ReorderChildLayers(ui::Layer* parent_layer) { |
1558 if (layer() && layer() != parent_layer) { | 1558 if (layer() && layer() != parent_layer) { |
1559 DCHECK_EQ(parent_layer, layer()->parent()); | 1559 DCHECK_EQ(parent_layer, layer()->parent()); |
1560 parent_layer->StackAtBottom(layer()); | 1560 parent_layer->StackAtBottom(layer()); |
1561 } else { | 1561 } else { |
1562 // Iterate backwards through the children so that a child with a layer | 1562 // Iterate backwards through the children so that a child with a layer |
1563 // which is further to the back is stacked above one which is further to | 1563 // which is further to the back is stacked above one which is further to |
1564 // the front. | 1564 // the front. |
1565 for (Views::const_reverse_iterator it(children_.rbegin()); | 1565 for (Views::reverse_iterator it(children_.rbegin()); |
1566 it != children_.rend(); ++it) { | 1566 it != children_.rend(); ++it) { |
1567 (*it)->ReorderChildLayers(parent_layer); | 1567 (*it)->ReorderChildLayers(parent_layer); |
1568 } | 1568 } |
1569 } | 1569 } |
1570 } | 1570 } |
1571 | 1571 |
1572 // Input ----------------------------------------------------------------------- | 1572 // Input ----------------------------------------------------------------------- |
1573 | 1573 |
1574 bool View::HasHitTestMask() const { | 1574 bool View::HasHitTestMask() const { |
1575 return false; | 1575 return false; |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2387 // Message the RootView to do the drag and drop. That way if we're removed | 2387 // Message the RootView to do the drag and drop. That way if we're removed |
2388 // the RootView can detect it and avoid calling us back. | 2388 // the RootView can detect it and avoid calling us back. |
2389 gfx::Point widget_location(event.location()); | 2389 gfx::Point widget_location(event.location()); |
2390 ConvertPointToWidget(this, &widget_location); | 2390 ConvertPointToWidget(this, &widget_location); |
2391 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2391 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
2392 // WARNING: we may have been deleted. | 2392 // WARNING: we may have been deleted. |
2393 return true; | 2393 return true; |
2394 } | 2394 } |
2395 | 2395 |
2396 } // namespace views | 2396 } // namespace views |
OLD | NEW |