Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Unified Diff: ui/views/view.h

Issue 381323002: [rough WIP] Make View::GetEventHandlerForRect() non-virtual (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/view.h
diff --git a/ui/views/view.h b/ui/views/view.h
index b0340ea14fbe07ba0c59ffdc57de8f6ea4b0bbec..ac2d8bcebbe3b52c6fb7336e27e48baa3acdd882 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -110,19 +110,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
public:
typedef std::vector<View*> Views;
- // TODO(tdanderson): Becomes obsolete with the refactoring of the event
- // targeting logic for views and windows. See
- // crbug.com/355425.
- // Specifies the source of the region used in a hit test.
- // HIT_TEST_SOURCE_MOUSE indicates the hit test is being performed with a
- // single point and HIT_TEST_SOURCE_TOUCH indicates the hit test is being
- // performed with a rect larger than a single point. This value can be used,
- // for example, to add extra padding or change the shape of the hit test mask.
- enum HitTestSource {
- HIT_TEST_SOURCE_MOUSE,
- HIT_TEST_SOURCE_TOUCH
- };
-
struct ViewHierarchyChangedDetails {
ViewHierarchyChangedDetails()
: is_add(false),
@@ -569,6 +556,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// a 1x1 rect centered at |point|.
View* GetEventHandlerForPoint(const gfx::Point& point);
+ // Terry - update doc
+
// If point-based targeting should be used, return the deepest visible
// descendant that contains the center point of |rect|.
// If rect-based targeting (i.e., fuzzing) should be used, return the
@@ -576,7 +565,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// its area covered by |rect|. If no such descendant exists, return the
// deepest visible descendant that contains the center point of |rect|.
// See http://goo.gl/3Jp2BD for more information about rect-based targeting.
- virtual View* GetEventHandlerForRect(const gfx::Rect& rect);
+ View* GetEventHandlerForRect(const gfx::Rect& rect);
// Returns the deepest visible descendant that contains the specified point
// and supports tooltips. If the view does not contain the point, returns
@@ -590,16 +579,14 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// the cursor is a shared resource.
virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event);
- // TODO(tdanderson): HitTestPoint() and HitTestRect() will be removed once
- // their logic is moved into ViewTargeter and its
- // derived classes. See crbug.com/355425.
-
// A convenience function which calls HitTestRect() with a rect of size
// 1x1 and an origin of |point|.
bool HitTestPoint(const gfx::Point& point) const;
- // Tests whether |rect| intersects this view's bounds.
- virtual bool HitTestRect(const gfx::Rect& rect) const;
+ // Tests whether |rect| intersects this view's bounds using the ViewTargeter
+ // installed on |this|. If there is no ViewTargeter installed on |this|, the
+ // ViewTargeter installed on the root view is used instead.
+ bool HitTestRect(const gfx::Rect& rect) const;
// Returns true if this view or any of its descendants are permitted to
// be the target of an event.
@@ -1146,20 +1133,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Input ---------------------------------------------------------------------
- // Called by HitTestRect() to see if this View has a custom hit test mask. If
- // the return value is true, GetHitTestMask() will be called to obtain the
- // mask. Default value is false, in which case the View will hit-test against
- // its bounds.
- virtual bool HasHitTestMask() const;
-
- // Called by HitTestRect() to retrieve a mask for hit-testing against.
- // Subclasses override to provide custom shaped hit test regions.
- // TODO(tdanderson): Remove this method once Tab, TabCloseButton,
- // NewTabButton, and MicButton all implement
- // MaskedViewTargeter.
- virtual void GetHitTestMaskDeprecated(HitTestSource source,
- gfx::Path* mask) const;
-
virtual DragInfo* GetDragInfo();
// Focus ---------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698