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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 // parent views do not change. | 386 // parent views do not change. |
387 void InvalidateLayout(); | 387 void InvalidateLayout(); |
388 | 388 |
389 // Gets/Sets the Layout Manager used by this view to size and place its | 389 // Gets/Sets the Layout Manager used by this view to size and place its |
390 // children. | 390 // children. |
391 // The LayoutManager is owned by the View and is deleted when the view is | 391 // The LayoutManager is owned by the View and is deleted when the view is |
392 // deleted, or when a new LayoutManager is installed. | 392 // deleted, or when a new LayoutManager is installed. |
393 LayoutManager* GetLayoutManager() const; | 393 LayoutManager* GetLayoutManager() const; |
394 void SetLayoutManager(LayoutManager* layout); | 394 void SetLayoutManager(LayoutManager* layout); |
395 | 395 |
| 396 // Adjust the layer's offset so that it snaps to the physical pixel boundary. |
| 397 // This has no effect if the view does not have an associated layer. |
| 398 void SnapLayerToPixelBoundary(); |
| 399 |
396 // Attributes ---------------------------------------------------------------- | 400 // Attributes ---------------------------------------------------------------- |
397 | 401 |
398 // The view class name. | 402 // The view class name. |
399 static const char kViewClassName[]; | 403 static const char kViewClassName[]; |
400 | 404 |
401 // Return the receiving view's class name. A view class is a string which | 405 // Return the receiving view's class name. A view class is a string which |
402 // uniquely identifies the view class. It is intended to be used as a way to | 406 // uniquely identifies the view class. It is intended to be used as a way to |
403 // find out during run time if a view can be safely casted to a specific view | 407 // find out during run time if a view can be safely casted to a specific view |
404 // subclass. The default implementation returns kViewClassName. | 408 // subclass. The default implementation returns kViewClassName. |
405 virtual const char* GetClassName() const; | 409 virtual const char* GetClassName() const; |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1546 | 1550 |
1547 // Layout -------------------------------------------------------------------- | 1551 // Layout -------------------------------------------------------------------- |
1548 | 1552 |
1549 // Whether the view needs to be laid out. | 1553 // Whether the view needs to be laid out. |
1550 bool needs_layout_; | 1554 bool needs_layout_; |
1551 | 1555 |
1552 // The View's LayoutManager defines the sizing heuristics applied to child | 1556 // The View's LayoutManager defines the sizing heuristics applied to child |
1553 // Views. The default is absolute positioning according to bounds_. | 1557 // Views. The default is absolute positioning according to bounds_. |
1554 scoped_ptr<LayoutManager> layout_manager_; | 1558 scoped_ptr<LayoutManager> layout_manager_; |
1555 | 1559 |
| 1560 // Whether this View's layer should be snapped to the pixel boundary. |
| 1561 bool snap_layer_to_pixel_boundary_; |
| 1562 |
1556 // Painting ------------------------------------------------------------------ | 1563 // Painting ------------------------------------------------------------------ |
1557 | 1564 |
1558 // Background | 1565 // Background |
1559 scoped_ptr<Background> background_; | 1566 scoped_ptr<Background> background_; |
1560 | 1567 |
1561 // Border. | 1568 // Border. |
1562 scoped_ptr<Border> border_; | 1569 scoped_ptr<Border> border_; |
1563 | 1570 |
1564 // RTL painting -------------------------------------------------------------- | 1571 // RTL painting -------------------------------------------------------------- |
1565 | 1572 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1616 // Belongs to this view, but it's reference-counted on some platforms | 1623 // Belongs to this view, but it's reference-counted on some platforms |
1617 // so we can't use a scoped_ptr. It's dereferenced in the destructor. | 1624 // so we can't use a scoped_ptr. It's dereferenced in the destructor. |
1618 NativeViewAccessibility* native_view_accessibility_; | 1625 NativeViewAccessibility* native_view_accessibility_; |
1619 | 1626 |
1620 DISALLOW_COPY_AND_ASSIGN(View); | 1627 DISALLOW_COPY_AND_ASSIGN(View); |
1621 }; | 1628 }; |
1622 | 1629 |
1623 } // namespace views | 1630 } // namespace views |
1624 | 1631 |
1625 #endif // UI_VIEWS_VIEW_H_ | 1632 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |