Commit 228d1772 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Shorten some code.

Bug: none
Change-Id: I759a442c973f85bd0363e1342d0e4ecfb9cf0fdc
Reviewed-on: https://chromium-review.googlesource.com/1132486Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573994}
parent 82c6081e
...@@ -360,20 +360,16 @@ bool BrowserNonClientFrameView::DoesIntersectRect(const views::View* target, ...@@ -360,20 +360,16 @@ bool BrowserNonClientFrameView::DoesIntersectRect(const views::View* target,
bool should_leave_to_top_container = false; bool should_leave_to_top_container = false;
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
if (browser_view()->immersive_mode_controller()->IsRevealed()) { // In immersive mode, the caption buttons container is reparented to the
// In immersive mode, the caption buttons container is reparented to the // TopContainerView and hence |rect| should not be claimed here. See
// TopContainerView and hence |rect| should not be claimed here. // BrowserNonClientFrameViewAsh::OnImmersiveRevealStarted().
// See BrowserNonClientFrameViewAsh::OnImmersiveRevealStarted(). should_leave_to_top_container =
should_leave_to_top_container = true; browser_view()->immersive_mode_controller()->IsRevealed();
}
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
if (!browser_view()->IsTabStripVisible()) { if (!browser_view()->IsTabStripVisible()) {
if (should_leave_to_top_container)
return false;
// Claim |rect| if it is above the top of the topmost client area view. // Claim |rect| if it is above the top of the topmost client area view.
return rect.y() < GetTopInset(false); return !should_leave_to_top_container && (rect.y() < GetTopInset(false));
} }
// If the rect is outside the bounds of the client area, claim it. // If the rect is outside the bounds of the client area, claim it.
...@@ -388,9 +384,6 @@ bool BrowserNonClientFrameView::DoesIntersectRect(const views::View* target, ...@@ -388,9 +384,6 @@ bool BrowserNonClientFrameView::DoesIntersectRect(const views::View* target,
// Otherwise, claim |rect| only if it is above the bottom of the tabstrip in // Otherwise, claim |rect| only if it is above the bottom of the tabstrip in
// a non-tab portion. // a non-tab portion.
TabStrip* tabstrip = browser_view()->tabstrip(); TabStrip* tabstrip = browser_view()->tabstrip();
if (!tabstrip || !browser_view()->IsTabStripVisible())
return false;
gfx::RectF rect_in_tabstrip_coords_f(rect); gfx::RectF rect_in_tabstrip_coords_f(rect);
View::ConvertRectToTarget(this, tabstrip, &rect_in_tabstrip_coords_f); View::ConvertRectToTarget(this, tabstrip, &rect_in_tabstrip_coords_f);
gfx::Rect rect_in_tabstrip_coords = gfx::Rect rect_in_tabstrip_coords =
...@@ -405,13 +398,10 @@ bool BrowserNonClientFrameView::DoesIntersectRect(const views::View* target, ...@@ -405,13 +398,10 @@ bool BrowserNonClientFrameView::DoesIntersectRect(const views::View* target,
return tabstrip->IsRectInWindowCaption(rect_in_tabstrip_coords); return tabstrip->IsRectInWindowCaption(rect_in_tabstrip_coords);
} }
if (should_leave_to_top_container)
return false;
// We claim |rect| because it is above the bottom of the tabstrip, but // We claim |rect| because it is above the bottom of the tabstrip, but
// not in the tabstrip itself. In particular, the avatar label/button is left // not in the tabstrip itself. In particular, the avatar label/button is left
// of the tabstrip and the window controls are right of the tabstrip. // of the tabstrip and the window controls are right of the tabstrip.
return true; return !should_leave_to_top_container;
} }
void BrowserNonClientFrameView::OnProfileAdded( void BrowserNonClientFrameView::OnProfileAdded(
......
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