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

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: Update 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..68f81f5edc334fe047bfad82e5cf6af277917625 100644
--- a/ui/views/cocoa/bridged_native_widget.h
+++ b/ui/views/cocoa/bridged_native_widget.h
@@ -29,6 +29,7 @@ class InputMethod;
namespace views {
class CocoaMouseCapture;
+class CocoaNonClientDrag;
class InputMethod;
class NativeWidgetMac;
class View;
@@ -132,6 +133,11 @@ 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
+ // is processed by NSWindows. Returning true here will cause the event to be
+ // reposted.
+ bool OnWindowWillReceiveLeftMouseDown(NSPoint location_in_window);
+
// Called by NativeWidgetMac when the window size constraints change.
void OnSizeConstraintsChanged();
@@ -228,6 +234,7 @@ class VIEWS_EXPORT BridgedNativeWidget : public ui::LayerDelegate,
base::scoped_nsobject<BridgedContentView> bridged_view_;
scoped_ptr<ui::InputMethod> input_method_;
scoped_ptr<CocoaMouseCapture> mouse_capture_;
+ scoped_ptr<CocoaNonClientDrag> non_client_drag_;
FocusManager* focus_manager_; // Weak. Owned by our Widget.
Widget::InitParams::Type widget_type_;
@@ -259,6 +266,12 @@ class VIEWS_EXPORT BridgedNativeWidget : public ui::LayerDelegate,
// currently hidden due to having a hidden parent.
bool wants_to_be_visible_;
+ // Whether the window's content view is currently draggable. Initially true
jackhou1 2015/05/20 05:50:36 This should initially be false, but we'd need to a
+ // because we make it non-draggable by adding a CocoaNonClientDragMaskView
+ // to the content view. After that, this is only true while we're handling
+ // a mouse-down that should drag the window.
+ bool draggable_ = true;
+
DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget);
};
« no previous file with comments | « chrome/browser/ui/views/apps/native_app_window_frame_view_mac.mm ('k') | ui/views/cocoa/bridged_native_widget.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698