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 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 // the views hierarchy. The above function gives the class the flexibility to | 1107 // the views hierarchy. The above function gives the class the flexibility to |
1108 // decide which object should be used to obtain the children, but this | 1108 // decide which object should be used to obtain the children, but this |
1109 // function makes the decision explicit. | 1109 // function makes the decision explicit. |
1110 std::string DoPrintViewGraph(bool first, View* view_with_children); | 1110 std::string DoPrintViewGraph(bool first, View* view_with_children); |
1111 #endif | 1111 #endif |
1112 | 1112 |
1113 private: | 1113 private: |
1114 friend class internal::RootView; | 1114 friend class internal::RootView; |
1115 friend class FocusManager; | 1115 friend class FocusManager; |
1116 friend class Widget; | 1116 friend class Widget; |
1117 friend class PaintLock; | |
1118 | 1117 |
1119 // Used to track a drag. RootView passes this into | 1118 // Used to track a drag. RootView passes this into |
1120 // ProcessMousePressed/Dragged. | 1119 // ProcessMousePressed/Dragged. |
1121 struct DragInfo { | 1120 struct DragInfo { |
1122 // Sets possible_drag to false and start_x/y to 0. This is invoked by | 1121 // Sets possible_drag to false and start_x/y to 0. This is invoked by |
1123 // RootView prior to invoke ProcessMousePressed. | 1122 // RootView prior to invoke ProcessMousePressed. |
1124 void Reset(); | 1123 void Reset(); |
1125 | 1124 |
1126 // Sets possible_drag to true and start_pt to the specified point. | 1125 // Sets possible_drag to true and start_pt to the specified point. |
1127 // This is invoked by the target view if it detects the press may generate | 1126 // This is invoked by the target view if it detects the press may generate |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1231 bool ConvertPointForAncestor(const View* ancestor, gfx::Point* point) const; | 1230 bool ConvertPointForAncestor(const View* ancestor, gfx::Point* point) const; |
1232 | 1231 |
1233 // Convert a point in the ancestor's coordinate system to the view's | 1232 // Convert a point in the ancestor's coordinate system to the view's |
1234 // coordinate system using necessary transformations. Returns whether the | 1233 // coordinate system using necessary transformations. Returns whether the |
1235 // point was successfully from the ancestor's coordinate system to the view's | 1234 // point was successfully from the ancestor's coordinate system to the view's |
1236 // coordinate system. | 1235 // coordinate system. |
1237 bool ConvertPointFromAncestor(const View* ancestor, gfx::Point* point) const; | 1236 bool ConvertPointFromAncestor(const View* ancestor, gfx::Point* point) const; |
1238 | 1237 |
1239 // Accelerated painting ------------------------------------------------------ | 1238 // Accelerated painting ------------------------------------------------------ |
1240 | 1239 |
1241 // Disables painting during time critical operations. Used by PaintLock. | |
1242 // TODO(vollick) Ideally, the widget would not dispatch paints into the | |
1243 // hierarchy during time critical operations and this would not be needed. | |
1244 void set_painting_enabled(bool enabled) { painting_enabled_ = enabled; } | |
1245 | |
1246 // Creates the layer and related fields for this view. | 1240 // Creates the layer and related fields for this view. |
1247 void CreateLayer(); | 1241 void CreateLayer(); |
1248 | 1242 |
1249 // Parents all un-parented layers within this view's hierarchy to this view's | 1243 // Parents all un-parented layers within this view's hierarchy to this view's |
1250 // layer. | 1244 // layer. |
1251 void UpdateParentLayers(); | 1245 void UpdateParentLayers(); |
1252 | 1246 |
1253 // Updates the view's layer's parent. Called when a view is added to a view | 1247 // Updates the view's layer's parent. Called when a view is added to a view |
1254 // hierarchy, responsible for parenting the view's layer to the enclosing | 1248 // hierarchy, responsible for parenting the view's layer to the enclosing |
1255 // layer in the hierarchy. | 1249 // layer in the hierarchy. |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 | 1359 |
1366 // This View's bounds in the parent coordinate system. | 1360 // This View's bounds in the parent coordinate system. |
1367 gfx::Rect bounds_; | 1361 gfx::Rect bounds_; |
1368 | 1362 |
1369 // Whether this view is visible. | 1363 // Whether this view is visible. |
1370 bool visible_; | 1364 bool visible_; |
1371 | 1365 |
1372 // Whether this view is enabled. | 1366 // Whether this view is enabled. |
1373 bool enabled_; | 1367 bool enabled_; |
1374 | 1368 |
1375 // Whether this view is painting. | |
1376 bool painting_enabled_; | |
1377 | |
1378 // When this flag is on, a View receives a mouse-enter and mouse-leave event | 1369 // When this flag is on, a View receives a mouse-enter and mouse-leave event |
1379 // even if a descendant View is the event-recipient for the real mouse | 1370 // even if a descendant View is the event-recipient for the real mouse |
1380 // events. When this flag is turned on, and mouse moves from outside of the | 1371 // events. When this flag is turned on, and mouse moves from outside of the |
1381 // view into a child view, both the child view and this view receives | 1372 // view into a child view, both the child view and this view receives |
1382 // mouse-enter event. Similarly, if the mouse moves from inside a child view | 1373 // mouse-enter event. Similarly, if the mouse moves from inside a child view |
1383 // and out of this view, then both views receive a mouse-leave event. | 1374 // and out of this view, then both views receive a mouse-leave event. |
1384 // When this flag is turned off, if the mouse moves from inside this view into | 1375 // When this flag is turned off, if the mouse moves from inside this view into |
1385 // a child view, then this view receives a mouse-leave event. When this flag | 1376 // a child view, then this view receives a mouse-leave event. When this flag |
1386 // is turned on, it does not receive the mouse-leave event in this case. | 1377 // is turned on, it does not receive the mouse-leave event in this case. |
1387 // When the mouse moves from inside the child view out of the child view but | 1378 // When the mouse moves from inside the child view out of the child view but |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 base::win::ScopedComPtr<NativeViewAccessibilityWin> | 1468 base::win::ScopedComPtr<NativeViewAccessibilityWin> |
1478 native_view_accessibility_win_; | 1469 native_view_accessibility_win_; |
1479 #endif | 1470 #endif |
1480 | 1471 |
1481 DISALLOW_COPY_AND_ASSIGN(View); | 1472 DISALLOW_COPY_AND_ASSIGN(View); |
1482 }; | 1473 }; |
1483 | 1474 |
1484 } // namespace views | 1475 } // namespace views |
1485 | 1476 |
1486 #endif // UI_VIEWS_VIEW_H_ | 1477 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |