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

Unified Diff: ui/views/cocoa/bridged_native_widget.h

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: Address comments. 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
Index: ui/views/cocoa/bridged_native_widget.h
diff --git a/ui/views/cocoa/bridged_native_widget.h b/ui/views/cocoa/bridged_native_widget.h
index badda952339963177b0c5ded3ec992bb78f4d53e..77cf10c6869a750657d69363c19f2dc5173fd3f1 100644
--- a/ui/views/cocoa/bridged_native_widget.h
+++ b/ui/views/cocoa/bridged_native_widget.h
@@ -132,6 +132,12 @@ class VIEWS_EXPORT BridgedNativeWidget : public ui::LayerDelegate,
// Called by the NSWindowDelegate when the window becomes or resigns key.
void OnWindowKeyStatusChangedTo(bool is_key);
+ // Called when the application receives a mouse-down, but before the event
tapted 2015/05/22 04:03:12 nit: start with "Called by the NSWindowDelegate".
jackhou1 2015/05/25 04:50:19 Done.
+ // is processed by NSWindows. Returning true here will cause the event to be
+ // cancelled and reposted at the CGSessionEventTap level. This is used to
+ // determine whether a mouse-down should drag the window.
+ bool ShouldRepostPendingLeftMouseDown(NSPoint location_in_window);
+
// Called by NativeWidgetMac when the window size constraints change.
void OnSizeConstraintsChanged();
@@ -189,6 +195,10 @@ class VIEWS_EXPORT BridgedNativeWidget : public ui::LayerDelegate,
// scale factor.
void UpdateLayerProperties();
+ // Sets mouseDownCanMoveWindow on |bridged_view_| and triggers the NSWindow to
+ // update its draggable region.
+ void SetDraggable(bool draggable);
+
// Overridden from CocoaMouseCaptureDelegate:
void PostCapturedEvent(NSEvent* event) override;
void OnMouseCaptureLost() override;

Powered by Google App Engine
This is Rietveld 408576698