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 1926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1937 | 1937 |
1938 if (use_acceleration_when_possible) { | 1938 if (use_acceleration_when_possible) { |
1939 if (layer()) { | 1939 if (layer()) { |
1940 if (parent_) { | 1940 if (parent_) { |
1941 SetLayerBounds(GetLocalBounds() + | 1941 SetLayerBounds(GetLocalBounds() + |
1942 gfx::Vector2d(GetMirroredX(), y()) + | 1942 gfx::Vector2d(GetMirroredX(), y()) + |
1943 parent_->CalculateOffsetToAncestorWithLayer(NULL)); | 1943 parent_->CalculateOffsetToAncestorWithLayer(NULL)); |
1944 } else { | 1944 } else { |
1945 SetLayerBounds(bounds_); | 1945 SetLayerBounds(bounds_); |
1946 } | 1946 } |
1947 // TODO(beng): this seems redundant with the SchedulePaint at the top of | |
1948 // this function. explore collapsing. | |
1949 if (previous_bounds.size() != bounds_.size() && | |
1950 !layer()->layer_updated_externally()) { | |
1951 // If our bounds have changed then we need to update the complete | |
1952 // texture. | |
1953 layer()->SchedulePaint(GetLocalBounds()); | |
1954 } | |
1955 } else { | 1947 } else { |
1956 // If our bounds have changed, then any descendant layer bounds may | 1948 // If our bounds have changed, then any descendant layer bounds may |
1957 // have changed. Update them accordingly. | 1949 // have changed. Update them accordingly. |
1958 UpdateChildLayerBounds(CalculateOffsetToAncestorWithLayer(NULL)); | 1950 UpdateChildLayerBounds(CalculateOffsetToAncestorWithLayer(NULL)); |
1959 } | 1951 } |
1960 } | 1952 } |
1961 | 1953 |
1962 OnBoundsChanged(previous_bounds); | 1954 OnBoundsChanged(previous_bounds); |
1963 | 1955 |
1964 if (previous_bounds.size() != size()) { | 1956 if (previous_bounds.size() != size()) { |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2395 // 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 |
2396 // the RootView can detect it and avoid calling us back. | 2388 // the RootView can detect it and avoid calling us back. |
2397 gfx::Point widget_location(event.location()); | 2389 gfx::Point widget_location(event.location()); |
2398 ConvertPointToWidget(this, &widget_location); | 2390 ConvertPointToWidget(this, &widget_location); |
2399 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2391 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
2400 // WARNING: we may have been deleted. | 2392 // WARNING: we may have been deleted. |
2401 return true; | 2393 return true; |
2402 } | 2394 } |
2403 | 2395 |
2404 } // namespace views | 2396 } // namespace views |
OLD | NEW |