Commit 829d90bd authored by Charlene Yan's avatar Charlene Yan Committed by Commit Bot

[Tab Scrolling] Check TabStripRegionView children for caption hit test.

This is needed to add buttons for tab scrolling.

Bug: 1129675
Change-Id: I07e57eb3cef149ec1b5606a96299a287467ee4bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2435815Reviewed-by: default avatarTaylor Bergquist <tbergquist@chromium.org>
Commit-Queue: Charlene Yan <cyan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811778}
parent 7b2b73c5
...@@ -94,13 +94,13 @@ bool TabStripRegionView::IsRectInWindowCaption(const gfx::Rect& rect) { ...@@ -94,13 +94,13 @@ bool TabStripRegionView::IsRectInWindowCaption(const gfx::Rect& rect) {
if (tab_strip_container_->HitTestRect(get_target_rect(tab_strip_container_))) if (tab_strip_container_->HitTestRect(get_target_rect(tab_strip_container_)))
return tab_strip_->IsRectInWindowCaption(get_target_rect(tab_strip_)); return tab_strip_->IsRectInWindowCaption(get_target_rect(tab_strip_));
// Check to see if the rect intersects the non-button parts of the tab search // The child could have a non-rectangular shape, so if the rect is not in the
// button. The enclosed button has a non-rectangular shape, so if it's not in // visual portions of the child view we treat it as a click to the caption.
// the visual portions of the buttons we treat it as a click to the caption. for (View* const child : children()) {
if (tab_search_button_ && tab_search_button_->GetLocalBounds().Intersects( if (child != tab_strip_container_ &&
get_target_rect(tab_search_button_))) { child->GetLocalBounds().Intersects(get_target_rect(child))) {
return !tab_search_button_->HitTestRect( return !child->HitTestRect(get_target_rect(child));
get_target_rect(tab_search_button_)); }
} }
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment