Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2595)

Unified Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc

Issue 2262563002: Refactor DoesIntersectRect into BrowserNonClientFrameView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc
index 5c95a6d6dbd219eba240ec411ba1e9df512923ff..9438b12375f2b04f1b8e8a82ae56e8a5f24131be 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc
@@ -376,33 +376,6 @@ void BrowserNonClientFrameViewMus::TabStripDeleted(TabStrip* tab_strip) {
tab_strip_ = nullptr;
}
-bool BrowserNonClientFrameViewMus::DoesIntersectRect(
- const views::View* target,
- const gfx::Rect& rect) const {
- CHECK_EQ(target, this);
- if (!views::ViewTargeterDelegate::DoesIntersectRect(this, rect)) {
- // |rect| is outside BrowserNonClientFrameViewMus's bounds.
- return false;
- }
-
- if (!browser_view()->IsTabStripVisible()) {
- // Claim |rect| if it is above the top of the topmost client area view.
- return rect.y() < GetTopInset(false);
- }
-
- // Claim |rect| only if it is above the bottom of the tabstrip in a non-tab
- // portion. In particular, the avatar label/button is left of the tabstrip and
- // the window controls are right of the tabstrip.
- TabStrip* tabstrip = browser_view()->tabstrip();
- gfx::RectF rect_in_tabstrip_coords_f(rect);
- View::ConvertRectToTarget(this, tabstrip, &rect_in_tabstrip_coords_f);
- const gfx::Rect rect_in_tabstrip_coords =
- gfx::ToEnclosingRect(rect_in_tabstrip_coords_f);
- return (rect_in_tabstrip_coords.y() <= tabstrip->height()) &&
- (!tabstrip->HitTestRect(rect_in_tabstrip_coords) ||
- tabstrip->IsRectInWindowCaption(rect_in_tabstrip_coords));
-}
-
int BrowserNonClientFrameViewMus::GetTabStripLeftInset() const {
const gfx::Insets insets(GetLayoutInsets(AVATAR_ICON));
const int avatar_right = profile_indicator_icon()

Powered by Google App Engine
This is Rietveld 408576698