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 #ifndef UI_VIEWS_VIEW_H_ | 5 #ifndef UI_VIEWS_VIEW_H_ |
6 #define UI_VIEWS_VIEW_H_ | 6 #define UI_VIEWS_VIEW_H_ |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 // Updates the view's layer's parent. Called when a view is added to a view | 1104 // Updates the view's layer's parent. Called when a view is added to a view |
1105 // hierarchy, responsible for parenting the view's layer to the enclosing | 1105 // hierarchy, responsible for parenting the view's layer to the enclosing |
1106 // layer in the hierarchy. | 1106 // layer in the hierarchy. |
1107 virtual void UpdateParentLayer(); | 1107 virtual void UpdateParentLayer(); |
1108 | 1108 |
1109 // If this view has a layer, the layer is reparented to |parent_layer| and its | 1109 // If this view has a layer, the layer is reparented to |parent_layer| and its |
1110 // bounds is set based on |point|. If this view does not have a layer, then | 1110 // bounds is set based on |point|. If this view does not have a layer, then |
1111 // recurses through all children. This is used when adding a layer to an | 1111 // recurses through all children. This is used when adding a layer to an |
1112 // existing view to make sure all descendants that have layers are parented to | 1112 // existing view to make sure all descendants that have layers are parented to |
1113 // the right layer. | 1113 // the right layer. |
1114 virtual void MoveLayerToParent(ui::Layer* parent_layer, | 1114 void MoveLayerToParent(ui::Layer* parent_layer, const gfx::Point& point); |
1115 const gfx::Point& point); | |
1116 | 1115 |
1117 // Called to update the bounds of any child layers within this View's | 1116 // Called to update the bounds of any child layers within this View's |
1118 // hierarchy when something happens to the hierarchy. | 1117 // hierarchy when something happens to the hierarchy. |
1119 virtual void UpdateChildLayerBounds(const gfx::Vector2d& offset); | 1118 void UpdateChildLayerBounds(const gfx::Vector2d& offset); |
1120 | 1119 |
1121 // Overridden from ui::LayerDelegate: | 1120 // Overridden from ui::LayerDelegate: |
1122 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; | 1121 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; |
1123 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; | 1122 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; |
1124 virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE; | 1123 virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE; |
1125 | 1124 |
1126 // Finds the layer that this view paints to (it may belong to an ancestor | 1125 // Finds the layer that this view paints to (it may belong to an ancestor |
1127 // view), then reorders the immediate children of that layer to match the | 1126 // view), then reorders the immediate children of that layer to match the |
1128 // order of the view tree. | 1127 // order of the view tree. |
1129 virtual void ReorderLayers(); | 1128 virtual void ReorderLayers(); |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1572 // Belongs to this view, but it's reference-counted on some platforms | 1571 // Belongs to this view, but it's reference-counted on some platforms |
1573 // so we can't use a scoped_ptr. It's dereferenced in the destructor. | 1572 // so we can't use a scoped_ptr. It's dereferenced in the destructor. |
1574 NativeViewAccessibility* native_view_accessibility_; | 1573 NativeViewAccessibility* native_view_accessibility_; |
1575 | 1574 |
1576 DISALLOW_COPY_AND_ASSIGN(View); | 1575 DISALLOW_COPY_AND_ASSIGN(View); |
1577 }; | 1576 }; |
1578 | 1577 |
1579 } // namespace views | 1578 } // namespace views |
1580 | 1579 |
1581 #endif // UI_VIEWS_VIEW_H_ | 1580 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |