Chromium Code Reviews| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 316 | 316 |
| 317 // Sets the transform to the supplied transform. | 317 // Sets the transform to the supplied transform. |
| 318 void SetTransform(const gfx::Transform& transform); | 318 void SetTransform(const gfx::Transform& transform); |
| 319 | 319 |
| 320 // Sets whether this view paints to a layer. A view paints to a layer if | 320 // Sets whether this view paints to a layer. A view paints to a layer if |
| 321 // either of the following are true: | 321 // either of the following are true: |
| 322 // . the view has a non-identity transform. | 322 // . the view has a non-identity transform. |
| 323 // . SetPaintToLayer(true) has been invoked. | 323 // . SetPaintToLayer(true) has been invoked. |
| 324 // View creates the Layer only when it exists in a Widget with a non-NULL | 324 // View creates the Layer only when it exists in a Widget with a non-NULL |
| 325 // Compositor. | 325 // Compositor. |
| 326 // TODO(mohsen): Consider making this robust against multiple places changing | |
| 327 // it at the same time. For example, class A might set this to true, then | |
| 328 // class B sets it to true. Then if class A sets it to false, the layer would | |
| 329 // be destroyed and class B might run into problems assuming it is still | |
| 330 // painting to layer. | |
|
sadrul
2016/06/16 15:56:27
We should not do this here. Normally, there would
mohsen
2016/06/16 16:28:47
OK. Removed.
| |
| 326 void SetPaintToLayer(bool paint_to_layer); | 331 void SetPaintToLayer(bool paint_to_layer); |
| 327 | 332 |
| 328 // Overridden from ui::LayerOwner: | 333 // Overridden from ui::LayerOwner: |
| 329 std::unique_ptr<ui::Layer> RecreateLayer() override; | 334 std::unique_ptr<ui::Layer> RecreateLayer() override; |
| 330 | 335 |
| 331 // RTL positioning ----------------------------------------------------------- | 336 // RTL positioning ----------------------------------------------------------- |
| 332 | 337 |
| 333 // Methods for accessing the bounds and position of the view, relative to its | 338 // Methods for accessing the bounds and position of the view, relative to its |
| 334 // parent. The position returned is mirrored if the parent view is using a RTL | 339 // parent. The position returned is mirrored if the parent view is using a RTL |
| 335 // layout. | 340 // layout. |
| (...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1569 // Belongs to this view, but it's reference-counted on some platforms | 1574 // Belongs to this view, but it's reference-counted on some platforms |
| 1570 // so we can't use a scoped_ptr. It's dereferenced in the destructor. | 1575 // so we can't use a scoped_ptr. It's dereferenced in the destructor. |
| 1571 NativeViewAccessibility* native_view_accessibility_; | 1576 NativeViewAccessibility* native_view_accessibility_; |
| 1572 | 1577 |
| 1573 DISALLOW_COPY_AND_ASSIGN(View); | 1578 DISALLOW_COPY_AND_ASSIGN(View); |
| 1574 }; | 1579 }; |
| 1575 | 1580 |
| 1576 } // namespace views | 1581 } // namespace views |
| 1577 | 1582 |
| 1578 #endif // UI_VIEWS_VIEW_H_ | 1583 #endif // UI_VIEWS_VIEW_H_ |
| OLD | NEW |