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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 // parent views do not change. | 373 // parent views do not change. |
374 void InvalidateLayout(); | 374 void InvalidateLayout(); |
375 | 375 |
376 // Gets/Sets the Layout Manager used by this view to size and place its | 376 // Gets/Sets the Layout Manager used by this view to size and place its |
377 // children. | 377 // children. |
378 // The LayoutManager is owned by the View and is deleted when the view is | 378 // The LayoutManager is owned by the View and is deleted when the view is |
379 // deleted, or when a new LayoutManager is installed. | 379 // deleted, or when a new LayoutManager is installed. |
380 LayoutManager* GetLayoutManager() const; | 380 LayoutManager* GetLayoutManager() const; |
381 void SetLayoutManager(LayoutManager* layout); | 381 void SetLayoutManager(LayoutManager* layout); |
382 | 382 |
| 383 // Adjust the layer's offset so that it snaps to the physical pixel boundary. |
| 384 // This has no effect if the view does not have an associated layer. |
| 385 void SnapLayerToPixelBoundary(); |
| 386 |
383 // Attributes ---------------------------------------------------------------- | 387 // Attributes ---------------------------------------------------------------- |
384 | 388 |
385 // The view class name. | 389 // The view class name. |
386 static const char kViewClassName[]; | 390 static const char kViewClassName[]; |
387 | 391 |
388 // Return the receiving view's class name. A view class is a string which | 392 // Return the receiving view's class name. A view class is a string which |
389 // uniquely identifies the view class. It is intended to be used as a way to | 393 // uniquely identifies the view class. It is intended to be used as a way to |
390 // find out during run time if a view can be safely casted to a specific view | 394 // find out during run time if a view can be safely casted to a specific view |
391 // subclass. The default implementation returns kViewClassName. | 395 // subclass. The default implementation returns kViewClassName. |
392 virtual const char* GetClassName() const; | 396 virtual const char* GetClassName() const; |
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1519 | 1523 |
1520 // Layout -------------------------------------------------------------------- | 1524 // Layout -------------------------------------------------------------------- |
1521 | 1525 |
1522 // Whether the view needs to be laid out. | 1526 // Whether the view needs to be laid out. |
1523 bool needs_layout_; | 1527 bool needs_layout_; |
1524 | 1528 |
1525 // The View's LayoutManager defines the sizing heuristics applied to child | 1529 // The View's LayoutManager defines the sizing heuristics applied to child |
1526 // Views. The default is absolute positioning according to bounds_. | 1530 // Views. The default is absolute positioning according to bounds_. |
1527 scoped_ptr<LayoutManager> layout_manager_; | 1531 scoped_ptr<LayoutManager> layout_manager_; |
1528 | 1532 |
| 1533 // Whether this View's layer should be snapped to the pixel boundary. |
| 1534 bool snap_layer_to_pixel_boundary_; |
| 1535 |
1529 // Painting ------------------------------------------------------------------ | 1536 // Painting ------------------------------------------------------------------ |
1530 | 1537 |
1531 // Background | 1538 // Background |
1532 scoped_ptr<Background> background_; | 1539 scoped_ptr<Background> background_; |
1533 | 1540 |
1534 // Border. | 1541 // Border. |
1535 scoped_ptr<Border> border_; | 1542 scoped_ptr<Border> border_; |
1536 | 1543 |
1537 // RTL painting -------------------------------------------------------------- | 1544 // RTL painting -------------------------------------------------------------- |
1538 | 1545 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1589 // Belongs to this view, but it's reference-counted on some platforms | 1596 // Belongs to this view, but it's reference-counted on some platforms |
1590 // so we can't use a scoped_ptr. It's dereferenced in the destructor. | 1597 // so we can't use a scoped_ptr. It's dereferenced in the destructor. |
1591 NativeViewAccessibility* native_view_accessibility_; | 1598 NativeViewAccessibility* native_view_accessibility_; |
1592 | 1599 |
1593 DISALLOW_COPY_AND_ASSIGN(View); | 1600 DISALLOW_COPY_AND_ASSIGN(View); |
1594 }; | 1601 }; |
1595 | 1602 |
1596 } // namespace views | 1603 } // namespace views |
1597 | 1604 |
1598 #endif // UI_VIEWS_VIEW_H_ | 1605 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |