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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 // NULL. | 570 // NULL. |
571 virtual View* GetTooltipHandlerForPoint(const gfx::Point& point); | 571 virtual View* GetTooltipHandlerForPoint(const gfx::Point& point); |
572 | 572 |
573 // Return the cursor that should be used for this view or the default cursor. | 573 // Return the cursor that should be used for this view or the default cursor. |
574 // The event location is in the receiver's coordinate system. The caller is | 574 // The event location is in the receiver's coordinate system. The caller is |
575 // responsible for managing the lifetime of the returned object, though that | 575 // responsible for managing the lifetime of the returned object, though that |
576 // lifetime may vary from platform to platform. On Windows and Aura, | 576 // lifetime may vary from platform to platform. On Windows and Aura, |
577 // the cursor is a shared resource. | 577 // the cursor is a shared resource. |
578 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event); | 578 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event); |
579 | 579 |
580 // TODO(tdanderson): HitTestPoint() and HitTestRect() will be removed once | |
581 // their logic is moved into ViewTargeter and its | |
582 // derived classes. See crbug.com/355425. | |
583 | |
584 // A convenience function which calls HitTestRect() with a rect of size | 580 // A convenience function which calls HitTestRect() with a rect of size |
585 // 1x1 and an origin of |point|. | 581 // 1x1 and an origin of |point|. |
586 bool HitTestPoint(const gfx::Point& point) const; | 582 bool HitTestPoint(const gfx::Point& point) const; |
587 | 583 |
588 // Tests whether |rect| intersects this view's bounds. | 584 // Tests whether |rect| intersects this view's bounds using the ViewTargeter |
589 virtual bool HitTestRect(const gfx::Rect& rect) const; | 585 // installed on |this|. If there is no ViewTargeter installed on |this|, the |
| 586 // ViewTargeter installed on the root view is used instead. |
| 587 bool HitTestRect(const gfx::Rect& rect) const; |
590 | 588 |
591 // Returns true if this view or any of its descendants are permitted to | 589 // Returns true if this view or any of its descendants are permitted to |
592 // be the target of an event. | 590 // be the target of an event. |
593 virtual bool CanProcessEventsWithinSubtree() const; | 591 virtual bool CanProcessEventsWithinSubtree() const; |
594 | 592 |
595 // Returns true if the mouse cursor is over |view| and mouse events are | 593 // Returns true if the mouse cursor is over |view| and mouse events are |
596 // enabled. | 594 // enabled. |
597 bool IsMouseHovered(); | 595 bool IsMouseHovered(); |
598 | 596 |
599 // This method is invoked when the user clicks on this view. | 597 // This method is invoked when the user clicks on this view. |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1589 // Belongs to this view, but it's reference-counted on some platforms | 1587 // Belongs to this view, but it's reference-counted on some platforms |
1590 // so we can't use a scoped_ptr. It's dereferenced in the destructor. | 1588 // so we can't use a scoped_ptr. It's dereferenced in the destructor. |
1591 NativeViewAccessibility* native_view_accessibility_; | 1589 NativeViewAccessibility* native_view_accessibility_; |
1592 | 1590 |
1593 DISALLOW_COPY_AND_ASSIGN(View); | 1591 DISALLOW_COPY_AND_ASSIGN(View); |
1594 }; | 1592 }; |
1595 | 1593 |
1596 } // namespace views | 1594 } // namespace views |
1597 | 1595 |
1598 #endif // UI_VIEWS_VIEW_H_ | 1596 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |