OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_VIEW_H_ | 5 #ifndef VIEWS_VIEW_H_ |
6 #define VIEWS_VIEW_H_ | 6 #define VIEWS_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1097 // used by the public static method ExceededDragThreshold(). | 1097 // used by the public static method ExceededDragThreshold(). |
1098 static int GetHorizontalDragThreshold(); | 1098 static int GetHorizontalDragThreshold(); |
1099 static int GetVerticalDragThreshold(); | 1099 static int GetVerticalDragThreshold(); |
1100 | 1100 |
1101 private: | 1101 private: |
1102 friend class internal::NativeWidgetView; | 1102 friend class internal::NativeWidgetView; |
1103 friend class internal::RootView; | 1103 friend class internal::RootView; |
1104 friend class FocusManager; | 1104 friend class FocusManager; |
1105 friend class ViewStorage; | 1105 friend class ViewStorage; |
1106 friend class Widget; | 1106 friend class Widget; |
1107 friend class PaintLock; | |
1107 | 1108 |
1108 // Used to track a drag. RootView passes this into | 1109 // Used to track a drag. RootView passes this into |
1109 // ProcessMousePressed/Dragged. | 1110 // ProcessMousePressed/Dragged. |
1110 struct DragInfo { | 1111 struct DragInfo { |
1111 // Sets possible_drag to false and start_x/y to 0. This is invoked by | 1112 // Sets possible_drag to false and start_x/y to 0. This is invoked by |
1112 // RootView prior to invoke ProcessMousePressed. | 1113 // RootView prior to invoke ProcessMousePressed. |
1113 void Reset(); | 1114 void Reset(); |
1114 | 1115 |
1115 // Sets possible_drag to true and start_pt to the specified point. | 1116 // Sets possible_drag to true and start_pt to the specified point. |
1116 // This is invoked by the target view if it detects the press may generate | 1117 // This is invoked by the target view if it detects the press may generate |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1222 bool ConvertPointForAncestor(const View* ancestor, gfx::Point* point) const; | 1223 bool ConvertPointForAncestor(const View* ancestor, gfx::Point* point) const; |
1223 | 1224 |
1224 // Convert a point in the ancestor's coordinate system to the view's | 1225 // Convert a point in the ancestor's coordinate system to the view's |
1225 // coordinate system using necessary transformations. Returns whether the | 1226 // coordinate system using necessary transformations. Returns whether the |
1226 // point was successfully from the ancestor's coordinate system to the view's | 1227 // point was successfully from the ancestor's coordinate system to the view's |
1227 // coordinate system. | 1228 // coordinate system. |
1228 bool ConvertPointFromAncestor(const View* ancestor, gfx::Point* point) const; | 1229 bool ConvertPointFromAncestor(const View* ancestor, gfx::Point* point) const; |
1229 | 1230 |
1230 // Accelerated painting ------------------------------------------------------ | 1231 // Accelerated painting ------------------------------------------------------ |
1231 | 1232 |
1233 // Disables painting during time-critical operations. Used by PaintLock. | |
1234 void set_painting_enabled(bool enabled) { painting_enabled_ = enabled; } | |
Ben Goodger (Google)
2011/08/31 20:34:00
It troubles me that we need this.
It seems like t
| |
1235 | |
1232 // Returns true if this view should paint to layer. | 1236 // Returns true if this view should paint to layer. |
1233 bool ShouldPaintToLayer() const; | 1237 bool ShouldPaintToLayer() const; |
1234 | 1238 |
1235 // Creates the layer and related fields for this view. | 1239 // Creates the layer and related fields for this view. |
1236 void CreateLayer(); | 1240 void CreateLayer(); |
1237 | 1241 |
1238 // Reparents any descendant layer to our current layer parent and destroys | 1242 // Reparents any descendant layer to our current layer parent and destroys |
1239 // this views layer. | 1243 // this views layer. |
1240 void DestroyLayerAndReparent(); | 1244 void DestroyLayerAndReparent(); |
1241 | 1245 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1346 | 1350 |
1347 // This View's bounds in the parent coordinate system. | 1351 // This View's bounds in the parent coordinate system. |
1348 gfx::Rect bounds_; | 1352 gfx::Rect bounds_; |
1349 | 1353 |
1350 // Whether this view is visible. | 1354 // Whether this view is visible. |
1351 bool visible_; | 1355 bool visible_; |
1352 | 1356 |
1353 // Whether this view is enabled. | 1357 // Whether this view is enabled. |
1354 bool enabled_; | 1358 bool enabled_; |
1355 | 1359 |
1360 // Whether this view is painting. | |
1361 bool painting_enabled_; | |
1362 | |
1356 // Whether or not RegisterViewForVisibleBoundsNotification on the RootView | 1363 // Whether or not RegisterViewForVisibleBoundsNotification on the RootView |
1357 // has been invoked. | 1364 // has been invoked. |
1358 bool registered_for_visible_bounds_notification_; | 1365 bool registered_for_visible_bounds_notification_; |
1359 | 1366 |
1360 // List of descendants wanting notification when their visible bounds change. | 1367 // List of descendants wanting notification when their visible bounds change. |
1361 scoped_ptr<Views> descendants_to_notify_; | 1368 scoped_ptr<Views> descendants_to_notify_; |
1362 | 1369 |
1363 // Transformations ----------------------------------------------------------- | 1370 // Transformations ----------------------------------------------------------- |
1364 | 1371 |
1365 // Clipping parameters. skia transformation matrix does not give us clipping. | 1372 // Clipping parameters. skia transformation matrix does not give us clipping. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1440 #if defined(OS_WIN) | 1447 #if defined(OS_WIN) |
1441 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; | 1448 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; |
1442 #endif | 1449 #endif |
1443 | 1450 |
1444 DISALLOW_COPY_AND_ASSIGN(View); | 1451 DISALLOW_COPY_AND_ASSIGN(View); |
1445 }; | 1452 }; |
1446 | 1453 |
1447 } // namespace views | 1454 } // namespace views |
1448 | 1455 |
1449 #endif // VIEWS_VIEW_H_ | 1456 #endif // VIEWS_VIEW_H_ |
OLD | NEW |