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 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1182 virtual void ReorderLayers(); | 1182 virtual void ReorderLayers(); |
1183 | 1183 |
1184 // This reorders the immediate children of |*parent_layer| to match the | 1184 // This reorders the immediate children of |*parent_layer| to match the |
1185 // order of the view tree. Child layers which are owned by a view are | 1185 // order of the view tree. Child layers which are owned by a view are |
1186 // reordered so that they are below any child layers not owned by a view. | 1186 // reordered so that they are below any child layers not owned by a view. |
1187 // Widget::ReorderNativeViews() should be called to reorder any child layers | 1187 // Widget::ReorderNativeViews() should be called to reorder any child layers |
1188 // with an associated view. Widget::ReorderNativeViews() may reorder layers | 1188 // with an associated view. Widget::ReorderNativeViews() may reorder layers |
1189 // below layers owned by a view. | 1189 // below layers owned by a view. |
1190 virtual void ReorderChildLayers(ui::Layer* parent_layer); | 1190 virtual void ReorderChildLayers(ui::Layer* parent_layer); |
1191 | 1191 |
| 1192 // Notifies parents about a layer being created or destroyed in a child. An |
| 1193 // example where a subclass may override this method is when it wants to clip |
| 1194 // the child by adding its own layer. |
| 1195 virtual void OnChildLayerChanged(View* child); |
| 1196 |
1192 // Input --------------------------------------------------------------------- | 1197 // Input --------------------------------------------------------------------- |
1193 | 1198 |
1194 virtual DragInfo* GetDragInfo(); | 1199 virtual DragInfo* GetDragInfo(); |
1195 | 1200 |
1196 // Focus --------------------------------------------------------------------- | 1201 // Focus --------------------------------------------------------------------- |
1197 | 1202 |
1198 // Returns last set focus behavior. | 1203 // Returns last set focus behavior. |
1199 FocusBehavior focus_behavior() const { return focus_behavior_; } | 1204 FocusBehavior focus_behavior() const { return focus_behavior_; } |
1200 | 1205 |
1201 // Override to be notified when focus has changed either to or from this View. | 1206 // Override to be notified when focus has changed either to or from this View. |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 // WriteDragData to write the data and GetDragOperations to determine the | 1513 // WriteDragData to write the data and GetDragOperations to determine the |
1509 // supported drag operations. When done, OnDragDone is invoked. |press_pt| is | 1514 // supported drag operations. When done, OnDragDone is invoked. |press_pt| is |
1510 // in the view's coordinate system. | 1515 // in the view's coordinate system. |
1511 // Returns true if a drag was started. | 1516 // Returns true if a drag was started. |
1512 bool DoDrag(const ui::LocatedEvent& event, | 1517 bool DoDrag(const ui::LocatedEvent& event, |
1513 const gfx::Point& press_pt, | 1518 const gfx::Point& press_pt, |
1514 ui::DragDropTypes::DragEventSource source); | 1519 ui::DragDropTypes::DragEventSource source); |
1515 | 1520 |
1516 ////////////////////////////////////////////////////////////////////////////// | 1521 ////////////////////////////////////////////////////////////////////////////// |
1517 | 1522 |
| 1523 // Notifies parents about layering changes in the view. This includes layer |
| 1524 // creation and destruction. |
| 1525 void NotifyParentsOfLayerChange(); |
| 1526 |
1518 // Creation and lifetime ----------------------------------------------------- | 1527 // Creation and lifetime ----------------------------------------------------- |
1519 | 1528 |
1520 // False if this View is owned by its parent - i.e. it will be deleted by its | 1529 // False if this View is owned by its parent - i.e. it will be deleted by its |
1521 // parent during its parents destruction. False is the default. | 1530 // parent during its parents destruction. False is the default. |
1522 bool owned_by_client_; | 1531 bool owned_by_client_; |
1523 | 1532 |
1524 // Attributes ---------------------------------------------------------------- | 1533 // Attributes ---------------------------------------------------------------- |
1525 | 1534 |
1526 // The id of this View. Used to find this View. | 1535 // The id of this View. Used to find this View. |
1527 int id_; | 1536 int id_; |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1670 // Observers ------------------------------------------------------------- | 1679 // Observers ------------------------------------------------------------- |
1671 | 1680 |
1672 base::ObserverList<ViewObserver> observers_; | 1681 base::ObserverList<ViewObserver> observers_; |
1673 | 1682 |
1674 DISALLOW_COPY_AND_ASSIGN(View); | 1683 DISALLOW_COPY_AND_ASSIGN(View); |
1675 }; | 1684 }; |
1676 | 1685 |
1677 } // namespace views | 1686 } // namespace views |
1678 | 1687 |
1679 #endif // UI_VIEWS_VIEW_H_ | 1688 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |