From 6322965c27dc59aad2ca6b4c22f30e30c460da67 Mon Sep 17 00:00:00 2001 From: "beng@google.com" Date: Sun, 14 Sep 2008 20:07:29 +0000 Subject: Include the area to the right of the tabstrip underneath the window controls in the window caption area. B=1031854 Review URL: http://codereview.chromium.org/2840 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2202 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/views/frame/browser_view2.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'chrome/browser') diff --git a/chrome/browser/views/frame/browser_view2.cc b/chrome/browser/views/frame/browser_view2.cc index d0d724c..c0e067b 100644 --- a/chrome/browser/views/frame/browser_view2.cc +++ b/chrome/browser/views/frame/browser_view2.cc @@ -20,10 +20,12 @@ #include "chrome/browser/views/toolbar_view.h" #include "chrome/common/drag_drop_types.h" #include "chrome/common/l10n_util.h" +#include "chrome/common/notification_service.h" #include "chrome/common/os_exchange_data.h" #include "chrome/common/pref_names.h" #include "chrome/common/resource_bundle.h" #include "chrome/common/win_util.h" +#include "chrome/views/hwnd_notification_source.h" #include "chrome/views/view.h" #include "chrome/views/window.h" @@ -677,12 +679,9 @@ bool BrowserView2::CanClose() const { } // Empty TabStripModel, it's now safe to allow the Window to be closed. - /* - // TODO(beng): for some reason, this won't compile. Figure it out. NotificationService::current()->Notify( NOTIFY_WINDOW_CLOSED, Source(frame_->GetWindow()->GetHWND()), NotificationService::NoDetails()); - */ return true; } @@ -730,6 +729,15 @@ int BrowserView2::NonClientHitTest(const gfx::Point& point) { if (gfx::Rect(bounds).Contains(point.x(), point.y())) return HTCLIENT; + // 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). + GetBounds(&bounds); + bounds.bottom = GetY() + toolbar_->GetY(); + if (gfx::Rect(bounds).Contains(point.x(), point.y())) + return HTCAPTION; + // If the point is somewhere else, delegate to the default implementation. return ClientView::NonClientHitTest(point); } -- cgit v1.1