Chromium Code Reviews| Index: chrome/browser/ui/views/frame/browser_view_layout.cc |
| diff --git a/chrome/browser/ui/views/frame/browser_view_layout.cc b/chrome/browser/ui/views/frame/browser_view_layout.cc |
| index a015739735db702a0e7db047c136ab4075dffc7f..04d1028c25aec967579e86e5cf1c3ec7834ffb3f 100644 |
| --- a/chrome/browser/ui/views/frame/browser_view_layout.cc |
| +++ b/chrome/browser/ui/views/frame/browser_view_layout.cc |
| @@ -249,13 +249,25 @@ gfx::Rect BrowserViewLayout::GetFindBarBoundingBox() const { |
| bool BrowserViewLayout::IsPositionInWindowCaption( |
| const gfx::Point& point) { |
| - // Tab strip may transiently have no parent between the RemoveChildView() and |
| - // AddChildView() caused by reparenting during an immersive mode reveal. |
| - // During this window report that the point didn't hit a tab. |
| - if (!tab_strip_->parent()) |
| - return true; |
| + views::View* window_switcher_button = delegate_->GetWindowSwitcherButton(); |
| + if (window_switcher_button) { |
| + gfx::Point window_switcher_point(point); |
| + views::View::ConvertPointToTarget(browser_view_, window_switcher_button, |
| + &window_switcher_point); |
| + if (window_switcher_button->HitTestPoint(window_switcher_point)) |
| + return false; |
| + } |
| + |
| gfx::Point tabstrip_point(point); |
| views::View::ConvertPointToTarget(browser_view_, tab_strip_, &tabstrip_point); |
| + |
| + // NonClientFrameView::HitTestRect() should have filtered out any points |
| + // below |tab_strip_|. |
| + DCHECK_LE(point.y(), tab_strip_->bounds().bottom()); |
| + |
| + // The window controls are in the non client view. |
| + if (!tab_strip_->HitTestPoint(tabstrip_point)) |
|
James Cook
2013/07/12 23:12:12
Is there some other way to do this? In particular
|
| + return true; |
| return tab_strip_->IsPositionInWindowCaption(tabstrip_point); |
| } |