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

Unified Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm

Issue 1146873002: [MacViews] Enable dragging a window by its caption/draggable areas. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase Created 5 years, 7 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
« no previous file with comments | « chrome/browser/ui/views/frame/browser_frame_mac.mm ('k') | ui/base/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm
index 5eaf26d1d1b176bfc5e37e8b70eaa7189c5bb33f..e7de1ed417159445864f78ff76db1330d1841c7e 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm
@@ -69,7 +69,15 @@ gfx::Rect BrowserNonClientFrameViewMac::GetWindowBoundsForClientBounds(
}
int BrowserNonClientFrameViewMac::NonClientHitTest(const gfx::Point& point) {
- return frame()->client_view()->NonClientHitTest(point);
+ int component = frame()->client_view()->NonClientHitTest(point);
+
+ // BrowserView::NonClientHitTest will return HTNOWHERE for points that hit
+ // the native title bar. On Mac, we need to explicitly return HTCAPTION for
+ // those points.
+ if (component == HTNOWHERE && bounds().Contains(point))
+ return HTCAPTION;
+
+ return component;
}
void BrowserNonClientFrameViewMac::GetWindowMask(const gfx::Size& size,
« no previous file with comments | « chrome/browser/ui/views/frame/browser_frame_mac.mm ('k') | ui/base/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698