Chromium Code Reviews| Index: chrome/browser/ui/views/apps/native_app_window_frame_view_mac.mm |
| diff --git a/chrome/browser/ui/views/apps/native_app_window_frame_view_mac.mm b/chrome/browser/ui/views/apps/native_app_window_frame_view_mac.mm |
| index 444a6df4035c9770e18b577ca1e5c8d7574335ed..d0ce2dcff2ae8b6e46d6d900f75bd5b1d84f2b7e 100644 |
| --- a/chrome/browser/ui/views/apps/native_app_window_frame_view_mac.mm |
| +++ b/chrome/browser/ui/views/apps/native_app_window_frame_view_mac.mm |
| @@ -6,11 +6,15 @@ |
| #import <Cocoa/Cocoa.h> |
| +#include "extensions/browser/app_window/native_app_window.h" |
| +#include "ui/base/hit_test.h" |
| #import "ui/gfx/mac/coordinate_conversion.h" |
| #include "ui/views/widget/widget.h" |
| -NativeAppWindowFrameViewMac::NativeAppWindowFrameViewMac(views::Widget* frame) |
| - : views::NativeFrameView(frame) { |
| +NativeAppWindowFrameViewMac::NativeAppWindowFrameViewMac( |
| + views::Widget* frame, |
| + extensions::NativeAppWindow* window) |
| + : views::NativeFrameView(frame), native_app_window_(window) { |
| } |
| NativeAppWindowFrameViewMac::~NativeAppWindowFrameViewMac() { |
| @@ -27,3 +31,16 @@ gfx::Rect NativeAppWindowFrameViewMac::GetWindowBoundsForClientBounds( |
| window_bounds.set_size(gfx::Size(1, 1)); |
| return window_bounds; |
| } |
| + |
| +int NativeAppWindowFrameViewMac::NonClientHitTest(const gfx::Point& point) { |
| + if (GetWidget()->IsFullscreen()) |
| + return HTCLIENT; |
| + |
| + // Check for possible draggable region in the client area for the frameless |
| + // window. |
| + SkRegion* draggable_region = native_app_window_->GetDraggableRegion(); |
| + if (draggable_region && draggable_region->contains(point.x(), point.y())) |
| + return HTCAPTION; |
| + |
| + return HTCLIENT; |
|
tapted
2015/05/20 07:18:15
AppWindowFrameView::NonClientHitTest defaults to H
jackhou1
2015/05/22 02:49:16
I think (at least on Mac) that app windows can onl
|
| +} |
|
tapted
2015/05/20 07:18:15
no you need to return HTNOWHERE ever? (otherwise D
jackhou1
2015/05/22 02:49:16
Done.
|