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

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: 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 | « ui/views/cocoa/bridged_content_view.mm ('k') | ui/views/cocoa/bridged_native_widget.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a4e4b1d9541b779f703730e6f5d15936e02527ab..5f52831ecbbff6776393bc61fb7753c8dc3b1c1d 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 by NSWindowDelegate when the application receives a mouse-down, but
+ // before the event 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.
+ virtual bool ShouldRepostPendingLeftMouseDown(NSPoint location_in_window);
+
// Called by NativeWidgetMac when the window size constraints change.
void OnSizeConstraintsChanged();
@@ -191,6 +197,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;
« no previous file with comments | « ui/views/cocoa/bridged_content_view.mm ('k') | ui/views/cocoa/bridged_native_widget.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698