| 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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 OnEnabledChanged(); | 494 OnEnabledChanged(); |
| 495 } | 495 } |
| 496 } | 496 } |
| 497 | 497 |
| 498 void View::OnEnabledChanged() { | 498 void View::OnEnabledChanged() { |
| 499 SchedulePaint(); | 499 SchedulePaint(); |
| 500 } | 500 } |
| 501 | 501 |
| 502 // Transformations ------------------------------------------------------------- | 502 // Transformations ------------------------------------------------------------- |
| 503 | 503 |
| 504 const gfx::Transform& View::GetTransform() const { | 504 gfx::Transform View::GetTransform() const { |
| 505 static const gfx::Transform* no_op = new gfx::Transform; | 505 return layer() ? layer()->transform() : gfx::Transform(); |
| 506 return layer() ? layer()->transform() : *no_op; | |
| 507 } | 506 } |
| 508 | 507 |
| 509 void View::SetTransform(const gfx::Transform& transform) { | 508 void View::SetTransform(const gfx::Transform& transform) { |
| 510 if (transform.IsIdentity()) { | 509 if (transform.IsIdentity()) { |
| 511 if (layer()) { | 510 if (layer()) { |
| 512 layer()->SetTransform(transform); | 511 layer()->SetTransform(transform); |
| 513 if (!paint_to_layer_) | 512 if (!paint_to_layer_) |
| 514 DestroyLayer(); | 513 DestroyLayer(); |
| 515 } else { | 514 } else { |
| 516 // Nothing. | 515 // Nothing. |
| (...skipping 1757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2274 ConvertPointToWidget(this, &widget_location); | 2273 ConvertPointToWidget(this, &widget_location); |
| 2275 GetWidget()->RunShellDrag(this, data, widget_location, drag_operations, | 2274 GetWidget()->RunShellDrag(this, data, widget_location, drag_operations, |
| 2276 source); | 2275 source); |
| 2277 return true; | 2276 return true; |
| 2278 #else | 2277 #else |
| 2279 return false; | 2278 return false; |
| 2280 #endif // !defined(OS_MACOSX) | 2279 #endif // !defined(OS_MACOSX) |
| 2281 } | 2280 } |
| 2282 | 2281 |
| 2283 } // namespace views | 2282 } // namespace views |
| OLD | NEW |