| 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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 // their logic is moved into ViewTargeter and its | 594 // their logic is moved into ViewTargeter and its |
| 595 // derived classes. See crbug.com/355425. | 595 // derived classes. See crbug.com/355425. |
| 596 | 596 |
| 597 // A convenience function which calls HitTestRect() with a rect of size | 597 // A convenience function which calls HitTestRect() with a rect of size |
| 598 // 1x1 and an origin of |point|. | 598 // 1x1 and an origin of |point|. |
| 599 bool HitTestPoint(const gfx::Point& point) const; | 599 bool HitTestPoint(const gfx::Point& point) const; |
| 600 | 600 |
| 601 // Tests whether |rect| intersects this view's bounds. | 601 // Tests whether |rect| intersects this view's bounds. |
| 602 virtual bool HitTestRect(const gfx::Rect& rect) const; | 602 virtual bool HitTestRect(const gfx::Rect& rect) const; |
| 603 | 603 |
| 604 // Returns true if this view or any of its descendants are permitted to |
| 605 // be the target of an event. |
| 606 virtual bool CanProcessEventsWithinSubtree() const; |
| 607 |
| 604 // Returns true if the mouse cursor is over |view| and mouse events are | 608 // Returns true if the mouse cursor is over |view| and mouse events are |
| 605 // enabled. | 609 // enabled. |
| 606 bool IsMouseHovered(); | 610 bool IsMouseHovered(); |
| 607 | 611 |
| 608 // This method is invoked when the user clicks on this view. | 612 // This method is invoked when the user clicks on this view. |
| 609 // The provided event is in the receiver's coordinate system. | 613 // The provided event is in the receiver's coordinate system. |
| 610 // | 614 // |
| 611 // Return true if you processed the event and want to receive subsequent | 615 // Return true if you processed the event and want to receive subsequent |
| 612 // MouseDraggged and MouseReleased events. This also stops the event from | 616 // MouseDraggged and MouseReleased events. This also stops the event from |
| 613 // bubbling. If you return false, the event will bubble through parent | 617 // bubbling. If you return false, the event will bubble through parent |
| (...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1607 // Belongs to this view, but it's reference-counted on some platforms | 1611 // Belongs to this view, but it's reference-counted on some platforms |
| 1608 // so we can't use a scoped_ptr. It's dereferenced in the destructor. | 1612 // so we can't use a scoped_ptr. It's dereferenced in the destructor. |
| 1609 NativeViewAccessibility* native_view_accessibility_; | 1613 NativeViewAccessibility* native_view_accessibility_; |
| 1610 | 1614 |
| 1611 DISALLOW_COPY_AND_ASSIGN(View); | 1615 DISALLOW_COPY_AND_ASSIGN(View); |
| 1612 }; | 1616 }; |
| 1613 | 1617 |
| 1614 } // namespace views | 1618 } // namespace views |
| 1615 | 1619 |
| 1616 #endif // UI_VIEWS_VIEW_H_ | 1620 #endif // UI_VIEWS_VIEW_H_ |
| OLD | NEW |