Index: chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc |
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc |
index 947622c4bbf6d54027ee96fa2b8595998d81cf5d..4a4798cd6689b069e2486a11330226678bb6672c 100644 |
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc |
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc |
@@ -246,6 +246,35 @@ void BrowserNonClientFrameViewAsh::UpdateWindowTitle() { |
header_painter_->SchedulePaintForTitle(); |
} |
+bool BrowserNonClientFrameViewAsh::DoesIntersectRect( |
+ const views::View* target, |
+ const gfx::Rect& rect) const { |
+ CHECK_EQ(target, this); |
+ if (!views::ViewTargeterDelegate::DoesIntersectRect(this, rect)) { |
+ // |rect| is outside BrowserNonClientFrameViewAsh's bounds. |
+ return false; |
+ } |
+ |
+ TabStrip* tabstrip = browser_view()->tabstrip(); |
+ if (tabstrip && browser_view()->IsTabStripVisible()) { |
+ // Claim |rect| only if it is above the bottom of the tabstrip in a non-tab |
+ // portion. |
+ gfx::RectF rect_in_tabstrip_coords_f(rect); |
+ View::ConvertRectToTarget(this, tabstrip, &rect_in_tabstrip_coords_f); |
+ gfx::Rect rect_in_tabstrip_coords = gfx::ToEnclosingRect( |
+ rect_in_tabstrip_coords_f); |
+ |
+ if (rect_in_tabstrip_coords.y() > tabstrip->height()) |
+ return false; |
+ |
+ return !tabstrip->HitTestRect(rect_in_tabstrip_coords) || |
+ tabstrip->IsRectInWindowCaption(rect_in_tabstrip_coords); |
+ } |
+ |
+ // Claim |rect| if it is above the top of the topmost view in the client area. |
+ return rect.y() < GetTopInset(); |
+} |
+ |
/////////////////////////////////////////////////////////////////////////////// |
// views::View: |
@@ -296,32 +325,6 @@ const char* BrowserNonClientFrameViewAsh::GetClassName() const { |
return kViewClassName; |
} |
-bool BrowserNonClientFrameViewAsh::HitTestRect(const gfx::Rect& rect) const { |
- if (!views::View::HitTestRect(rect)) { |
- // |rect| is outside BrowserNonClientFrameViewAsh's bounds. |
- return false; |
- } |
- |
- TabStrip* tabstrip = browser_view()->tabstrip(); |
- if (tabstrip && browser_view()->IsTabStripVisible()) { |
- // Claim |rect| only if it is above the bottom of the tabstrip in a non-tab |
- // portion. |
- gfx::RectF rect_in_tabstrip_coords_f(rect); |
- View::ConvertRectToTarget(this, tabstrip, &rect_in_tabstrip_coords_f); |
- gfx::Rect rect_in_tabstrip_coords = gfx::ToEnclosingRect( |
- rect_in_tabstrip_coords_f); |
- |
- if (rect_in_tabstrip_coords.y() > tabstrip->height()) |
- return false; |
- |
- return !tabstrip->HitTestRect(rect_in_tabstrip_coords) || |
- tabstrip->IsRectInWindowCaption(rect_in_tabstrip_coords); |
- } |
- |
- // Claim |rect| if it is above the top of the topmost view in the client area. |
- return rect.y() < GetTopInset(); |
-} |
- |
void BrowserNonClientFrameViewAsh::GetAccessibleState( |
ui::AXViewState* state) { |
state->role = ui::AX_ROLE_TITLE_BAR; |