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..1d4288916d93772e87b44558a758e52912a34862 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 |
@@ -296,32 +296,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; |
@@ -380,6 +354,36 @@ gfx::ImageSkia BrowserNonClientFrameViewAsh::GetFaviconForTabIconView() { |
/////////////////////////////////////////////////////////////////////////////// |
// BrowserNonClientFrameViewAsh, private: |
+// views::NonClientFrameView: |
+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(); |
+} |
+ |
int BrowserNonClientFrameViewAsh::GetTabStripLeftInset() const { |
return avatar_button() ? kAvatarSideSpacing + |
browser_view()->GetOTRAvatarIcon().width() + kAvatarSideSpacing : |