Tab close buttons can only be targeted with touch if the whole button is visible
commit10ffdedd530604ff892ed68d456f281343470766
authortdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 6 Feb 2014 10:17:20 +0000 (6 10:17 +0000)
committertdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 6 Feb 2014 10:17:20 +0000 (6 10:17 +0000)
tree05e9311117c25be7804d7e610e21c36d3eb44537
parent7c7a517bcf66778a0fee4e53194541207385fc8e
Tab close buttons can only be targeted with touch if the whole button is visible

As a result of r246686 landing, tabs can be too easy to close with
touch in stacked tab mode when rect-based targeting is enabled.
This patch changes the behaviour so that:

(1) Hit tests in response to a mouse event will always consider the
    region of the tab close button that is visible.
(2) Hit tests in response to a gesture will only consider the tab
    close button to be a valid target if the entire button is
    visible to the user.

Note that if there is any vertical clipping of the tab
close button, we do not consider the clipped
region to be a part of the button's bounds.

BUG=338516,332334
TEST=TabStripTest.ClippedTabCloseButton, also manually tested on Windows when tab close buttons are vertically clipped

Review URL: https://codereview.chromium.org/147623004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249331 0039d316-1c4b-4281-b951-d872f2087c98
chrome/browser/ui/views/tabs/tab.cc
chrome/browser/ui/views/tabs/tab.h
chrome/browser/ui/views/tabs/tab_strip.h
chrome/browser/ui/views/tabs/tab_strip_unittest.cc