| 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 bool HitTestPoint(const gfx::Point& point) const; | 610 bool HitTestPoint(const gfx::Point& point) const; |
| 611 | 611 |
| 612 // Returns true if |rect| intersects this view's bounds. |rect| is in the | 612 // Returns true if |rect| intersects this view's bounds. |rect| is in the |
| 613 // local coordinate space of |this|. | 613 // local coordinate space of |this|. |
| 614 bool HitTestRect(const gfx::Rect& rect) const; | 614 bool HitTestRect(const gfx::Rect& rect) const; |
| 615 | 615 |
| 616 // Returns true if this view or any of its descendants are permitted to | 616 // Returns true if this view or any of its descendants are permitted to |
| 617 // be the target of an event. | 617 // be the target of an event. |
| 618 virtual bool CanProcessEventsWithinSubtree() const; | 618 virtual bool CanProcessEventsWithinSubtree() const; |
| 619 | 619 |
| 620 // Sets whether this view or any of its descendants are permitted to be the |
| 621 // target of an event. |
| 622 void set_can_process_events_within_subtree(bool can_process) { |
| 623 can_process_events_within_subtree_ = can_process; |
| 624 } |
| 625 |
| 620 // Returns true if the mouse cursor is over |view| and mouse events are | 626 // Returns true if the mouse cursor is over |view| and mouse events are |
| 621 // enabled. | 627 // enabled. |
| 622 bool IsMouseHovered() const; | 628 bool IsMouseHovered() const; |
| 623 | 629 |
| 624 // This method is invoked when the user clicks on this view. | 630 // This method is invoked when the user clicks on this view. |
| 625 // The provided event is in the receiver's coordinate system. | 631 // The provided event is in the receiver's coordinate system. |
| 626 // | 632 // |
| 627 // Return true if you processed the event and want to receive subsequent | 633 // Return true if you processed the event and want to receive subsequent |
| 628 // MouseDraggged and MouseReleased events. This also stops the event from | 634 // MouseDraggged and MouseReleased events. This also stops the event from |
| 629 // bubbling. If you return false, the event will bubble through parent | 635 // bubbling. If you return false, the event will bubble through parent |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1484 | 1490 |
| 1485 // This view's children. | 1491 // This view's children. |
| 1486 Views children_; | 1492 Views children_; |
| 1487 | 1493 |
| 1488 #if DCHECK_IS_ON() | 1494 #if DCHECK_IS_ON() |
| 1489 // True while iterating over |children_|. Used to detect and DCHECK when | 1495 // True while iterating over |children_|. Used to detect and DCHECK when |
| 1490 // |children_| is mutated during iteration. | 1496 // |children_| is mutated during iteration. |
| 1491 mutable bool iterating_; | 1497 mutable bool iterating_; |
| 1492 #endif | 1498 #endif |
| 1493 | 1499 |
| 1500 bool can_process_events_within_subtree_; |
| 1501 |
| 1494 // Size and disposition ------------------------------------------------------ | 1502 // Size and disposition ------------------------------------------------------ |
| 1495 | 1503 |
| 1496 // This View's bounds in the parent coordinate system. | 1504 // This View's bounds in the parent coordinate system. |
| 1497 gfx::Rect bounds_; | 1505 gfx::Rect bounds_; |
| 1498 | 1506 |
| 1499 // Whether this view is visible. | 1507 // Whether this view is visible. |
| 1500 bool visible_; | 1508 bool visible_; |
| 1501 | 1509 |
| 1502 // Whether this view is enabled. | 1510 // Whether this view is enabled. |
| 1503 bool enabled_; | 1511 bool enabled_; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1615 // Observers ------------------------------------------------------------- | 1623 // Observers ------------------------------------------------------------- |
| 1616 | 1624 |
| 1617 base::ObserverList<ViewObserver> observers_; | 1625 base::ObserverList<ViewObserver> observers_; |
| 1618 | 1626 |
| 1619 DISALLOW_COPY_AND_ASSIGN(View); | 1627 DISALLOW_COPY_AND_ASSIGN(View); |
| 1620 }; | 1628 }; |
| 1621 | 1629 |
| 1622 } // namespace views | 1630 } // namespace views |
| 1623 | 1631 |
| 1624 #endif // UI_VIEWS_VIEW_H_ | 1632 #endif // UI_VIEWS_VIEW_H_ |
| OLD | NEW |