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

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

Issue 2475173002: MacViews: Fix window dragging on Sierra. (Closed)
Patch Set: Rebase. Update comment. #include=>#import. Created 4 years, 1 month 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 | « base/mac/sdk_forward_declarations.h ('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 58c60b659c0d06de71a6efbe08a2270a04c6c6d0..4a4acdefa6298d22295e548523ac62516c25969e 100644
--- a/ui/views/cocoa/bridged_native_widget.h
+++ b/ui/views/cocoa/bridged_native_widget.h
@@ -67,6 +67,9 @@ class VIEWS_EXPORT BridgedNativeWidget
static gfx::Size GetWindowSizeForClientSize(NSWindow* window,
const gfx::Size& size);
+ // Whether an event monitor should be used to intercept window drag events.
+ static bool ShouldUseDragEventMonitor();
+
// Creates one side of the bridge. |parent| must not be NULL.
explicit BridgedNativeWidget(NativeWidgetMac* parent);
~BridgedNativeWidget() override;
@@ -151,11 +154,16 @@ class VIEWS_EXPORT BridgedNativeWidget
// 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);
+ // Returns true if the |event| should initiate a window drag.
+ bool ShouldDragWindow(NSEvent* event);
+
+ // Called when the application receives a mouse-down, but before the event is
+ // processed by NSWindow. 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. Only called when
+ // ShouldUseDragEventMonitor() returns true.
+ // Virtual for testing.
+ virtual bool ShouldRepostPendingLeftMouseDown(NSEvent* event);
// Called by NativeWidgetMac when the window size constraints change.
void OnSizeConstraintsChanged();
« no previous file with comments | « base/mac/sdk_forward_declarations.h ('k') | ui/views/cocoa/bridged_native_widget.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698