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 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 // Whether the press may generate a drag. | 936 // Whether the press may generate a drag. |
937 bool possible_drag; | 937 bool possible_drag; |
938 | 938 |
939 // Coordinates of the mouse press. | 939 // Coordinates of the mouse press. |
940 gfx::Point start_pt; | 940 gfx::Point start_pt; |
941 }; | 941 }; |
942 | 942 |
943 // Size and disposition ------------------------------------------------------ | 943 // Size and disposition ------------------------------------------------------ |
944 | 944 |
945 // Override to be notified when the bounds of the view have changed. | 945 // Override to be notified when the bounds of the view have changed. |
946 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds); | 946 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) {} |
947 | 947 |
948 // Called when the preferred size of a child view changed. This gives the | 948 // Called when the preferred size of a child view changed. This gives the |
949 // parent an opportunity to do a fresh layout if that makes sense. | 949 // parent an opportunity to do a fresh layout if that makes sense. |
950 virtual void ChildPreferredSizeChanged(View* child) {} | 950 virtual void ChildPreferredSizeChanged(View* child); |
951 | 951 |
952 // Called when the visibility of a child view changed. This gives the parent | 952 // Called when the visibility of a child view changed. This gives the parent |
953 // an opportunity to do a fresh layout if that makes sense. | 953 // an opportunity to do a fresh layout if that makes sense. |
954 virtual void ChildVisibilityChanged(View* child) {} | 954 virtual void ChildVisibilityChanged(View* child) {} |
955 | 955 |
956 // Invalidates the layout and calls ChildPreferredSizeChanged on the parent | 956 // Invalidates the layout and calls ChildPreferredSizeChanged on the parent |
957 // if there is one. Be sure to call View::PreferredSizeChanged when | 957 // if there is one. Be sure to call View::PreferredSizeChanged when |
958 // overriding such that the layout is properly invalidated. | 958 // overriding such that the layout is properly invalidated. |
959 virtual void PreferredSizeChanged(); | 959 virtual void PreferredSizeChanged(); |
960 | 960 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 // the views hierarchy. The above function gives the class the flexibility to | 1161 // the views hierarchy. The above function gives the class the flexibility to |
1162 // decide which object should be used to obtain the children, but this | 1162 // decide which object should be used to obtain the children, but this |
1163 // function makes the decision explicit. | 1163 // function makes the decision explicit. |
1164 std::string DoPrintViewGraph(bool first, View* view_with_children); | 1164 std::string DoPrintViewGraph(bool first, View* view_with_children); |
1165 #endif | 1165 #endif |
1166 | 1166 |
1167 private: | 1167 private: |
1168 friend class internal::PostEventDispatchHandler; | 1168 friend class internal::PostEventDispatchHandler; |
1169 friend class internal::RootView; | 1169 friend class internal::RootView; |
1170 friend class FocusManager; | 1170 friend class FocusManager; |
| 1171 friend class LayoutManager; |
1171 friend class Widget; | 1172 friend class Widget; |
1172 | 1173 |
1173 // Painting ----------------------------------------------------------------- | 1174 // Painting ----------------------------------------------------------------- |
1174 | 1175 |
1175 enum SchedulePaintType { | 1176 enum SchedulePaintType { |
1176 // Indicates the size is the same (only the origin changed). | 1177 // Indicates the size is the same (only the origin changed). |
1177 SCHEDULE_PAINT_SIZE_SAME, | 1178 SCHEDULE_PAINT_SIZE_SAME, |
1178 | 1179 |
1179 // Indicates the size changed (and possibly the origin). | 1180 // Indicates the size changed (and possibly the origin). |
1180 SCHEDULE_PAINT_SIZE_CHANGED | 1181 SCHEDULE_PAINT_SIZE_CHANGED |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 // Belongs to this view, but it's reference-counted on some platforms | 1505 // Belongs to this view, but it's reference-counted on some platforms |
1505 // so we can't use a scoped_ptr. It's dereferenced in the destructor. | 1506 // so we can't use a scoped_ptr. It's dereferenced in the destructor. |
1506 NativeViewAccessibility* native_view_accessibility_; | 1507 NativeViewAccessibility* native_view_accessibility_; |
1507 | 1508 |
1508 DISALLOW_COPY_AND_ASSIGN(View); | 1509 DISALLOW_COPY_AND_ASSIGN(View); |
1509 }; | 1510 }; |
1510 | 1511 |
1511 } // namespace views | 1512 } // namespace views |
1512 | 1513 |
1513 #endif // UI_VIEWS_VIEW_H_ | 1514 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |