| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef UI_GFX_COMPOSITOR_LAYER_PROPERTY_SETTER_H_ | 5 #ifndef UI_GFX_COMPOSITOR_LAYER_PROPERTY_SETTER_H_ |
| 6 #define UI_GFX_COMPOSITOR_LAYER_PROPERTY_SETTER_H_ | 6 #define UI_GFX_COMPOSITOR_LAYER_PROPERTY_SETTER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "views/views_export.h" | 9 #include "views/views_export.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 // When a property of layer needs to be changed it is set by way of | 22 // When a property of layer needs to be changed it is set by way of |
| 23 // LayerPropertySetter. This enables LayerPropertySetter to animate property | 23 // LayerPropertySetter. This enables LayerPropertySetter to animate property |
| 24 // changes. | 24 // changes. |
| 25 class VIEWS_EXPORT LayerPropertySetter { | 25 class VIEWS_EXPORT LayerPropertySetter { |
| 26 public: | 26 public: |
| 27 // Creates a LayerPropertySetter that immediately sets the values on the | 27 // Creates a LayerPropertySetter that immediately sets the values on the |
| 28 // layer. Ownership returns to caller. | 28 // layer. Ownership returns to caller. |
| 29 static LayerPropertySetter* CreateDefaultSetter(); | 29 static LayerPropertySetter* CreateDefaultSetter(); |
| 30 | 30 |
| 31 // Creates a LayerPropertySetter that animates changes. Ownership returns to | |
| 32 // caller. | |
| 33 static LayerPropertySetter* CreateAnimatingSetter(); | |
| 34 | |
| 35 virtual ~LayerPropertySetter() {} | 31 virtual ~LayerPropertySetter() {} |
| 36 | 32 |
| 37 // Invoked when the LayerPropertySetter is to be used for a particular Layer. | 33 // Invoked when the LayerPropertySetter is to be used for a particular Layer. |
| 38 // This is invoked whenever a new Layer is created. A LayerPropertySetter is | 34 // This is invoked whenever a new Layer is created. A LayerPropertySetter is |
| 39 // only associated with one Layer at a time. | 35 // only associated with one Layer at a time. |
| 40 virtual void Installed(ui::Layer* layer) = 0; | 36 virtual void Installed(ui::Layer* layer) = 0; |
| 41 | 37 |
| 42 // Invoked when the Layer is destroyed. | 38 // Invoked when the Layer is destroyed. |
| 43 virtual void Uninstalled(ui::Layer* layer) = 0; | 39 virtual void Uninstalled(ui::Layer* layer) = 0; |
| 44 | 40 |
| 45 // Sets the transform on the Layer. | 41 // Sets the transform on the Layer. |
| 46 virtual void SetTransform(ui::Layer* layer, | 42 virtual void SetTransform(ui::Layer* layer, |
| 47 const ui::Transform& transform) = 0; | 43 const ui::Transform& transform) = 0; |
| 48 | 44 |
| 49 // Sets the bounds of the layer. | 45 // Sets the bounds of the layer. |
| 50 virtual void SetBounds(ui::Layer* layer, const gfx::Rect& bounds) = 0; | 46 virtual void SetBounds(ui::Layer* layer, const gfx::Rect& bounds) = 0; |
| 51 }; | 47 }; |
| 52 | 48 |
| 53 } // namespace views | 49 } // namespace views |
| 54 | 50 |
| 55 #endif // UI_GFX_COMPOSITOR_LAYER_PROPERTY_SETTER_H_ | 51 #endif // UI_GFX_COMPOSITOR_LAYER_PROPERTY_SETTER_H_ |
| OLD | NEW |