diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-18 03:47:13 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-18 03:47:13 +0000 |
commit | 3dd099178f7a16b3eb0ef8c63574a2f281cf3bc5 (patch) | |
tree | 8055fc54f08cc73db256b7c4fd86eee7af6799e4 /chrome/browser/views/frame | |
parent | 126720dd09a08ae7391568fe19f403a050be0627 (diff) | |
download | chromium_src-3dd099178f7a16b3eb0ef8c63574a2f281cf3bc5.zip chromium_src-3dd099178f7a16b3eb0ef8c63574a2f281cf3bc5.tar.gz chromium_src-3dd099178f7a16b3eb0ef8c63574a2f281cf3bc5.tar.bz2 |
Make sure window controls in maximized browser windows can be hit-tested as the appropriate HTCLOSE HTMINBUTTON etc types. Buggy code would previously prevent this from happening by detecting the entire area to the right of the tabstrip as being part of the caption.
http://crbug.com/2449
Review URL: http://codereview.chromium.org/2955
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2354 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/frame')
-rw-r--r-- | chrome/browser/views/frame/browser_view2.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/views/frame/browser_view2.cc b/chrome/browser/views/frame/browser_view2.cc index b609d1c..843ba45 100644 --- a/chrome/browser/views/frame/browser_view2.cc +++ b/chrome/browser/views/frame/browser_view2.cc @@ -747,11 +747,17 @@ int BrowserView2::NonClientHitTest(const gfx::Point& point) { // If the point's y coordinate is above the top of the toolbar, but not in // the tabstrip (per previous checking in this function), then we consider it // in the window caption (e.g. the area to the right of the tabstrip - // underneath the window controls). + // underneath the window controls). However, note that we DO NOT return + // HTCAPTION here, because when the window is maximized the window controls + // will fall into this space (since the BrowserView2 is sized to entire size + // of the window at that point), and the HTCAPTION value will cause the + // window controls not to work. So we return HTNOWHERE so that the caller + // will hit-test the window controls before finally falling back to + // HTCAPTION. GetBounds(&bounds); bounds.bottom = y() + toolbar_->y(); if (gfx::Rect(bounds).Contains(point.x(), point.y())) - return HTCAPTION; + return HTNOWHERE; // If the point is somewhere else, delegate to the default implementation. return ClientView::NonClientHitTest(point); |