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

Side by Side Diff: ui/views/cocoa/bridged_native_widget.h

Issue 1718043003: MacViews: Clip contents for non-rectangular windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add tests. Created 4 years, 9 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
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9
10 #include <vector> 10 #include <vector>
(...skipping 13 matching lines...) Expand all
24 @class BridgedContentView; 24 @class BridgedContentView;
25 @class ViewsNSWindowDelegate; 25 @class ViewsNSWindowDelegate;
26 26
27 namespace ui { 27 namespace ui {
28 class InputMethod; 28 class InputMethod;
29 } 29 }
30 30
31 namespace views { 31 namespace views {
32 namespace test { 32 namespace test {
33 class BridgedNativeWidgetTestApi; 33 class BridgedNativeWidgetTestApi;
34 class BridgedNativeWidgetTest;
34 } 35 }
35 36
36 class CocoaMouseCapture; 37 class CocoaMouseCapture;
37 class NativeWidgetMac; 38 class NativeWidgetMac;
38 class View; 39 class View;
39 40
40 // A bridge to an NSWindow managed by an instance of NativeWidgetMac or 41 // A bridge to an NSWindow managed by an instance of NativeWidgetMac or
41 // DesktopNativeWidgetMac. Serves as a helper class to bridge requests from the 42 // DesktopNativeWidgetMac. Serves as a helper class to bridge requests from the
42 // NativeWidgetMac to the Cocoa window. Behaves a bit like an aura::Window. 43 // NativeWidgetMac to the Cocoa window. Behaves a bit like an aura::Window.
43 class VIEWS_EXPORT BridgedNativeWidget 44 class VIEWS_EXPORT BridgedNativeWidget
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 } 172 }
172 173
173 bool target_fullscreen_state() const { return target_fullscreen_state_; } 174 bool target_fullscreen_state() const { return target_fullscreen_state_; }
174 bool window_visible() { return window_visible_; } 175 bool window_visible() { return window_visible_; }
175 176
176 // Overridden from ui::internal::InputMethodDelegate: 177 // Overridden from ui::internal::InputMethodDelegate:
177 ui::EventDispatchDetails DispatchKeyEventPostIME(ui::KeyEvent* key) override; 178 ui::EventDispatchDetails DispatchKeyEventPostIME(ui::KeyEvent* key) override;
178 179
179 private: 180 private:
180 friend class test::BridgedNativeWidgetTestApi; 181 friend class test::BridgedNativeWidgetTestApi;
182 friend class test::BridgedNativeWidgetTest;
181 183
182 // Closes all child windows. BridgedNativeWidget children will be destroyed. 184 // Closes all child windows. BridgedNativeWidget children will be destroyed.
183 void RemoveOrDestroyChildren(); 185 void RemoveOrDestroyChildren();
184 186
185 // Notify descendants of a visibility change. 187 // Notify descendants of a visibility change.
186 void NotifyVisibilityChangeDown(); 188 void NotifyVisibilityChangeDown();
187 189
188 // Essentially NativeWidgetMac::GetClientAreaBoundsInScreen().size(), but no 190 // Essentially NativeWidgetMac::GetClientAreaBoundsInScreen().size(), but no
189 // coordinate transformations are required from AppKit coordinates. 191 // coordinate transformations are required from AppKit coordinates.
190 gfx::Size GetClientAreaSize() const; 192 gfx::Size GetClientAreaSize() const;
(...skipping 17 matching lines...) Expand all
208 // frame is ready, or a timeout occurs. 210 // frame is ready, or a timeout occurs.
209 void MaybeWaitForFrame(const gfx::Size& size_in_dip); 211 void MaybeWaitForFrame(const gfx::Size& size_in_dip);
210 212
211 // Show the window using -[NSApp beginSheet:..], modal for the parent window. 213 // Show the window using -[NSApp beginSheet:..], modal for the parent window.
212 void ShowAsModalSheet(); 214 void ShowAsModalSheet();
213 215
214 // Sets mouseDownCanMoveWindow on |bridged_view_| and triggers the NSWindow to 216 // Sets mouseDownCanMoveWindow on |bridged_view_| and triggers the NSWindow to
215 // update its draggable region. 217 // update its draggable region.
216 void SetDraggable(bool draggable); 218 void SetDraggable(bool draggable);
217 219
220 // Calls updateWindowMask on |bridged_view_| and updates the mask path for
221 // |compositor_superview_|'s layer. If a mask layer does not yet exist, it
222 // creates a new one.
223 void UpdateMaskPath();
224
218 // Overridden from CocoaMouseCaptureDelegate: 225 // Overridden from CocoaMouseCaptureDelegate:
219 void PostCapturedEvent(NSEvent* event) override; 226 void PostCapturedEvent(NSEvent* event) override;
220 void OnMouseCaptureLost() override; 227 void OnMouseCaptureLost() override;
221 228
222 // Returns a properties dictionary associated with the NSWindow. 229 // Returns a properties dictionary associated with the NSWindow.
223 // Creates and attaches a new instance if not found. 230 // Creates and attaches a new instance if not found.
224 NSMutableDictionary* GetWindowProperties() const; 231 NSMutableDictionary* GetWindowProperties() const;
225 232
226 // Overridden from FocusChangeListener: 233 // Overridden from FocusChangeListener:
227 void OnWillChangeFocus(View* focused_before, 234 void OnWillChangeFocus(View* focused_before,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 // If true, the window has been made visible or changed shape and the window 295 // If true, the window has been made visible or changed shape and the window
289 // shadow needs to be invalidated when a frame is received for the new shape. 296 // shadow needs to be invalidated when a frame is received for the new shape.
290 bool invalidate_shadow_on_frame_swap_ = false; 297 bool invalidate_shadow_on_frame_swap_ = false;
291 298
292 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget); 299 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget);
293 }; 300 };
294 301
295 } // namespace views 302 } // namespace views
296 303
297 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ 304 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_
OLDNEW
« 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