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..8aa790a9b268f036d0fa45f83dccee372bf20e8c 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,17 @@ gfx::Rect NativeAppWindowFrameViewMac::GetWindowBoundsForClientBounds( |
| window_bounds.set_size(gfx::Size(1, 1)); |
| return window_bounds; |
| } |
| + |
| +int NativeAppWindowFrameViewMac::NonClientHitTest(const gfx::Point& point) { |
| + DCHECK(bounds().Contains(point)); |
|
jackhou1
2015/06/02 06:33:09
Ah, I think this still needs to be fixed. It shoul
jackhou1
2015/06/03 04:04:44
Done.
|
| + 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; |
| +} |