summaryrefslogtreecommitdiffstats
path: root/ui/views/view.cc
diff options
context:
space:
mode:
authortdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-04 21:14:30 +0000
committertdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-04 21:14:30 +0000
commitba278fc8bcdf07e2641d5556f7cf85bc8560ceeb (patch)
treec8ffe405b69a2fc1974c14cc96678b8f249fe17d /ui/views/view.cc
parent813e8eaf4c94aebd906378737e447c1918603969 (diff)
downloadchromium_src-ba278fc8bcdf07e2641d5556f7cf85bc8560ceeb.zip
chromium_src-ba278fc8bcdf07e2641d5556f7cf85bc8560ceeb.tar.gz
chromium_src-ba278fc8bcdf07e2641d5556f7cf85bc8560ceeb.tar.bz2
Modify hit test masks for tabs and tab close buttons
In preparation for landing rect-based event targeting (issue 129794), the tab close button will need a hit test mask and the hit test mask for a tab will need to be modified. This will take into consideration the possibility where the tab close button of one tab is occluded by another tab when in stacked tab / touch layout mode. BUG=306186 TEST=TabStripTest.TabHitTestMaskWhenStacked Review URL: https://codereview.chromium.org/32463003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232797 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/view.cc')
-rw-r--r--ui/views/view.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 3e0d55a..3d6b8f6 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -38,6 +38,7 @@
#include "ui/views/context_menu_controller.h"
#include "ui/views/drag_controller.h"
#include "ui/views/layout/layout_manager.h"
+#include "ui/views/rect_based_targeting_utils.h"
#include "ui/views/views_delegate.h"
#include "ui/views/widget/native_widget_private.h"
#include "ui/views/widget/root_view.h"
@@ -892,7 +893,10 @@ bool View::HitTestRect(const gfx::Rect& rect) const {
if (GetLocalBounds().Intersects(rect)) {
if (HasHitTestMask()) {
gfx::Path mask;
- GetHitTestMask(&mask);
+ HitTestSource source = HIT_TEST_SOURCE_MOUSE;
+ if (!views::UsePointBasedTargeting(rect))
+ source = HIT_TEST_SOURCE_TOUCH;
+ GetHitTestMask(source, &mask);
#if defined(USE_AURA)
// TODO: should we use this every where?
SkRegion clip_region;
@@ -1501,7 +1505,7 @@ bool View::HasHitTestMask() const {
return false;
}
-void View::GetHitTestMask(gfx::Path* mask) const {
+void View::GetHitTestMask(HitTestSource source, gfx::Path* mask) const {
DCHECK(mask);
}