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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ 5 #ifndef UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_
6 #define UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ 6 #define UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // Explicitly set the visibility. This is called when Cocoa requests a draw, 125 // Explicitly set the visibility. This is called when Cocoa requests a draw,
126 // but hasn't updated the value of -[NSWindow isVisible] yet. 126 // but hasn't updated the value of -[NSWindow isVisible] yet.
127 void OnVisibilityChangedTo(bool new_visibility); 127 void OnVisibilityChangedTo(bool new_visibility);
128 128
129 // Called by the NSWindowDelegate on a scale factor or color space change. 129 // Called by the NSWindowDelegate on a scale factor or color space change.
130 void OnBackingPropertiesChanged(); 130 void OnBackingPropertiesChanged();
131 131
132 // Called by the NSWindowDelegate when the window becomes or resigns key. 132 // Called by the NSWindowDelegate when the window becomes or resigns key.
133 void OnWindowKeyStatusChangedTo(bool is_key); 133 void OnWindowKeyStatusChangedTo(bool is_key);
134 134
135 // 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.
136 // is processed by NSWindows. Returning true here will cause the event to be
137 // cancelled and reposted at the CGSessionEventTap level. This is used to
138 // determine whether a mouse-down should drag the window.
139 bool ShouldRepostPendingLeftMouseDown(NSPoint location_in_window);
140
135 // Called by NativeWidgetMac when the window size constraints change. 141 // Called by NativeWidgetMac when the window size constraints change.
136 void OnSizeConstraintsChanged(); 142 void OnSizeConstraintsChanged();
137 143
138 // See widget.h for documentation. 144 // See widget.h for documentation.
139 InputMethod* CreateInputMethod(); 145 InputMethod* CreateInputMethod();
140 ui::InputMethod* GetHostInputMethod(); 146 ui::InputMethod* GetHostInputMethod();
141 147
142 // The restored bounds will be derived from the current NSWindow frame unless 148 // The restored bounds will be derived from the current NSWindow frame unless
143 // fullscreen or transitioning between fullscreen states. 149 // fullscreen or transitioning between fullscreen states.
144 gfx::Rect GetRestoredBounds() const; 150 gfx::Rect GetRestoredBounds() const;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 void DestroyCompositor(); 188 void DestroyCompositor();
183 189
184 // Installs the NSView for hosting the composited layer. It is later provided 190 // Installs the NSView for hosting the composited layer. It is later provided
185 // to |compositor_widget_| via AcceleratedWidgetGetNSView(). 191 // to |compositor_widget_| via AcceleratedWidgetGetNSView().
186 void AddCompositorSuperview(); 192 void AddCompositorSuperview();
187 193
188 // Size the layer to match the client area bounds, taking into account display 194 // Size the layer to match the client area bounds, taking into account display
189 // scale factor. 195 // scale factor.
190 void UpdateLayerProperties(); 196 void UpdateLayerProperties();
191 197
198 // Sets mouseDownCanMoveWindow on |bridged_view_| and triggers the NSWindow to
199 // update its draggable region.
200 void SetDraggable(bool draggable);
201
192 // Overridden from CocoaMouseCaptureDelegate: 202 // Overridden from CocoaMouseCaptureDelegate:
193 void PostCapturedEvent(NSEvent* event) override; 203 void PostCapturedEvent(NSEvent* event) override;
194 void OnMouseCaptureLost() override; 204 void OnMouseCaptureLost() override;
195 205
196 // Returns a properties dictionary associated with the NSWindow. 206 // Returns a properties dictionary associated with the NSWindow.
197 // Creates and attaches a new instance if not found. 207 // Creates and attaches a new instance if not found.
198 NSMutableDictionary* GetWindowProperties() const; 208 NSMutableDictionary* GetWindowProperties() const;
199 209
200 // Overridden from FocusChangeListener: 210 // Overridden from FocusChangeListener:
201 void OnWillChangeFocus(View* focused_before, 211 void OnWillChangeFocus(View* focused_before,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 // If true, the window is either visible, or wants to be visible but is 268 // If true, the window is either visible, or wants to be visible but is
259 // currently hidden due to having a hidden parent. 269 // currently hidden due to having a hidden parent.
260 bool wants_to_be_visible_; 270 bool wants_to_be_visible_;
261 271
262 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget); 272 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget);
263 }; 273 };
264 274
265 } // namespace views 275 } // namespace views
266 276
267 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ 277 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698