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

Unified Diff: ui/views/view.cc

Issue 365263004: Remove hit test mask methods from views::View (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-upload 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
« no previous file with comments | « ui/views/view.h ('k') | ui/views/view_targeter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 3809c1e73250005d9607e065292d14316ff57e81..0f57d89d7501d9478e74416e9e86618cd3f91871 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -954,29 +954,7 @@ bool View::HitTestRect(const gfx::Rect& rect) const {
if (!view_targeter)
view_targeter = GetWidget()->GetRootView()->targeter();
CHECK(view_targeter);
-
- // TODO(tdanderson): The check for !HasHitTestMask() is temporary. Remove
- // the check along with the duplicated code below once all
- // of the masked views subclass MaskedViewDelegate.
- // HasHitTestMask() and GetHitTestMaskDeprecated() can also
- // be removed from the View interface at that time.
- if (!HasHitTestMask())
- return view_targeter->DoesIntersectRect(this, rect);
-
- if (GetLocalBounds().Intersects(rect)) {
- gfx::Path mask;
- HitTestSource source = HIT_TEST_SOURCE_MOUSE;
- if (!views::UsePointBasedTargeting(rect))
- source = HIT_TEST_SOURCE_TOUCH;
- GetHitTestMaskDeprecated(source, &mask);
- SkRegion clip_region;
- clip_region.setRect(0, 0, width(), height());
- SkRegion mask_region;
- return mask_region.setPath(mask, clip_region) &&
- mask_region.intersects(RectToSkIRect(rect));
- }
- // Outside our bounds.
- return false;
+ return view_targeter->DoesIntersectRect(this, rect);
}
bool View::IsMouseHovered() {
@@ -1592,15 +1570,6 @@ void View::ReorderChildLayers(ui::Layer* parent_layer) {
// Input -----------------------------------------------------------------------
-bool View::HasHitTestMask() const {
- return false;
-}
-
-void View::GetHitTestMaskDeprecated(HitTestSource source,
- gfx::Path* mask) const {
- DCHECK(mask);
-}
-
View::DragInfo* View::GetDragInfo() {
return parent_ ? parent_->GetDragInfo() : NULL;
}
« no previous file with comments | « ui/views/view.h ('k') | ui/views/view_targeter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698