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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 namespace ui { | 55 namespace ui { |
56 struct AXActionData; | 56 struct AXActionData; |
57 struct AXNodeData; | 57 struct AXNodeData; |
58 class Compositor; | 58 class Compositor; |
59 class InputMethod; | 59 class InputMethod; |
60 class Layer; | 60 class Layer; |
61 class NativeTheme; | 61 class NativeTheme; |
62 class PaintContext; | 62 class PaintContext; |
63 class ThemeProvider; | 63 class ThemeProvider; |
| 64 class TransformRecorder; |
64 } | 65 } |
65 | 66 |
66 namespace views { | 67 namespace views { |
67 | 68 |
68 class Background; | 69 class Background; |
69 class Border; | 70 class Border; |
70 class ContextMenuController; | 71 class ContextMenuController; |
71 class DragController; | 72 class DragController; |
72 class FocusManager; | 73 class FocusManager; |
73 class FocusTraversable; | 74 class FocusTraversable; |
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1284 SCHEDULE_PAINT_SIZE_CHANGED | 1285 SCHEDULE_PAINT_SIZE_CHANGED |
1285 }; | 1286 }; |
1286 | 1287 |
1287 // Invoked before and after the bounds change to schedule painting the old and | 1288 // Invoked before and after the bounds change to schedule painting the old and |
1288 // new bounds. | 1289 // new bounds. |
1289 void SchedulePaintBoundsChanged(SchedulePaintType type); | 1290 void SchedulePaintBoundsChanged(SchedulePaintType type); |
1290 | 1291 |
1291 // Schedules a paint on the parent View if it exists. | 1292 // Schedules a paint on the parent View if it exists. |
1292 void SchedulePaintOnParent(); | 1293 void SchedulePaintOnParent(); |
1293 | 1294 |
| 1295 // Returns whether this view is eligible for painting, i.e. is visible and |
| 1296 // nonempty. Note that this does not behave like IsDrawn(), since it doesn't |
| 1297 // check ancestors recursively; rather, it's used to prune subtrees of views |
| 1298 // during painting. |
| 1299 bool ShouldPaint() const; |
| 1300 |
| 1301 // Returns the offset that should be used when constructing the paint context |
| 1302 // for this view. |
| 1303 gfx::Vector2d GetPaintContextOffset() const; |
| 1304 |
| 1305 // Adjusts the transform of |recorder| in advance of painting. |
| 1306 void SetupTransformRecorderForPainting(ui::TransformRecorder* recorder) const; |
| 1307 |
| 1308 // Recursively calls the painting method |func| on all non-layered children, |
| 1309 // in Z order. |
| 1310 void RecursivePaintHelper(void (View::*func)(const ui::PaintContext&), |
| 1311 const ui::PaintContext& context); |
| 1312 |
| 1313 // Invokes Paint() and, if necessary, PaintDebugRects(). Should be called |
| 1314 // only on the root of a widget/layer. PaintDebugRects() is invoked as a |
| 1315 // separate pass, instead of being rolled into Paint(), so that siblings will |
| 1316 // not obscure debug rects. |
| 1317 void PaintFromPaintRoot(const ui::PaintContext& parent_context); |
| 1318 |
| 1319 // Draws a semitransparent rect to indicate the bounds of this view. |
| 1320 // Recursively does the same for all children. Invoked only with |
| 1321 // --draw-view-bounds-rects. |
| 1322 void PaintDebugRects(const ui::PaintContext& parent_context); |
| 1323 |
1294 // Tree operations ----------------------------------------------------------- | 1324 // Tree operations ----------------------------------------------------------- |
1295 | 1325 |
1296 // Removes |view| from the hierarchy tree. If |update_focus_cycle| is true, | 1326 // Removes |view| from the hierarchy tree. If |update_focus_cycle| is true, |
1297 // the next and previous focusable views of views pointing to this view are | 1327 // the next and previous focusable views of views pointing to this view are |
1298 // updated. If |update_tool_tip| is true, the tooltip is updated. If | 1328 // updated. If |update_tool_tip| is true, the tooltip is updated. If |
1299 // |delete_removed_view| is true, the view is also deleted (if it is parent | 1329 // |delete_removed_view| is true, the view is also deleted (if it is parent |
1300 // owned). If |new_parent| is not NULL, the remove is the result of | 1330 // owned). If |new_parent| is not NULL, the remove is the result of |
1301 // AddChildView() to a new parent. For this case, |new_parent| is the View | 1331 // AddChildView() to a new parent. For this case, |new_parent| is the View |
1302 // that |view| is going to be added to after the remove completes. | 1332 // that |view| is going to be added to after the remove completes. |
1303 void DoRemoveChildView(View* view, | 1333 void DoRemoveChildView(View* view, |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1640 // Observers ------------------------------------------------------------- | 1670 // Observers ------------------------------------------------------------- |
1641 | 1671 |
1642 base::ObserverList<ViewObserver> observers_; | 1672 base::ObserverList<ViewObserver> observers_; |
1643 | 1673 |
1644 DISALLOW_COPY_AND_ASSIGN(View); | 1674 DISALLOW_COPY_AND_ASSIGN(View); |
1645 }; | 1675 }; |
1646 | 1676 |
1647 } // namespace views | 1677 } // namespace views |
1648 | 1678 |
1649 #endif // UI_VIEWS_VIEW_H_ | 1679 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |