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

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

Issue 19115003: Make the maximize button more easily hittable when there is a huge amount of tabs present (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed completely Created 7 years, 5 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_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 98f40fc89f790341307083cfbca261a15761b771..5ad033fbdb113a5b4261a324c95faa278c54521a 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
@@ -162,7 +162,8 @@ gfx::Rect BrowserNonClientFrameViewAsh::GetWindowBoundsForClientBounds(
client_bounds);
}
-int BrowserNonClientFrameViewAsh::NonClientHitTest(const gfx::Point& point) {
+int BrowserNonClientFrameViewAsh::NonClientHitTest(
+ const gfx::Point& point) const {
int hit_test = frame_painter_->NonClientHitTest(this, point);
// When the window is restored we want a large click target above the tabs
// to drag the window, so redirect clicks in the tab's shadow to caption.
@@ -264,28 +265,10 @@ const char* BrowserNonClientFrameViewAsh::GetClassName() const {
}
bool BrowserNonClientFrameViewAsh::HitTestRect(const gfx::Rect& rect) const {
- // If the rect is outside the bounds of the client area, claim it.
- if (NonClientFrameView::HitTestRect(rect))
- return true;
-
- // Otherwise claim it only if it's in a non-tab portion of the tabstrip.
- if (!browser_view()->tabstrip())
- return false;
- gfx::Rect tabstrip_bounds(browser_view()->tabstrip()->bounds());
- gfx::Point tabstrip_origin(tabstrip_bounds.origin());
- View::ConvertPointToTarget(frame()->client_view(), this, &tabstrip_origin);
- tabstrip_bounds.set_origin(tabstrip_origin);
- if (rect.bottom() > tabstrip_bounds.bottom())
James Cook 2013/07/16 19:25:52 I don't understand how we can get away with removi
- return false;
-
- // We convert from our parent's coordinates since we assume we fill its bounds
- // completely. We need to do this since we're not a parent of the tabstrip,
- // meaning ConvertPointToTarget would otherwise return something bogus.
// TODO(tdanderson): Initialize |browser_view_point| using |rect| instead of
// its center point once GetEventHandlerForRect() is implemented.
gfx::Point browser_view_point(rect.CenterPoint());
- View::ConvertPointToTarget(parent(), browser_view(), &browser_view_point);
- return browser_view()->IsPositionInWindowCaption(browser_view_point);
+ return NonClientHitTest(browser_view_point) != HTCLIENT;
James Cook 2013/07/16 19:25:52 Won't this return true if frame_painter_->NonClien
}
void BrowserNonClientFrameViewAsh::GetAccessibleState(

Powered by Google App Engine
This is Rietveld 408576698