OLD | NEW |
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // Sets the desired visibility of the window and updates the visibility of | 72 // Sets the desired visibility of the window and updates the visibility of |
73 // descendant windows where necessary. | 73 // descendant windows where necessary. |
74 void SetVisibilityState(WindowVisibilityState new_state); | 74 void SetVisibilityState(WindowVisibilityState new_state); |
75 | 75 |
76 // Acquiring mouse capture first steals capture from any existing | 76 // Acquiring mouse capture first steals capture from any existing |
77 // CocoaMouseCaptureDelegate, then captures all mouse events until released. | 77 // CocoaMouseCaptureDelegate, then captures all mouse events until released. |
78 void AcquireCapture(); | 78 void AcquireCapture(); |
79 void ReleaseCapture(); | 79 void ReleaseCapture(); |
80 bool HasCapture(); | 80 bool HasCapture(); |
81 | 81 |
| 82 // See views::Widget. |
| 83 void SetNativeWindowProperty(const char* key, void* value); |
| 84 void* GetNativeWindowProperty(const char* key) const; |
| 85 |
82 // Called internally by the NSWindowDelegate when the window is closing. | 86 // Called internally by the NSWindowDelegate when the window is closing. |
83 void OnWindowWillClose(); | 87 void OnWindowWillClose(); |
84 | 88 |
85 // Called by the NSWindowDelegate when a fullscreen operation begins. If | 89 // Called by the NSWindowDelegate when a fullscreen operation begins. If |
86 // |target_fullscreen_state| is true, the target state is fullscreen. | 90 // |target_fullscreen_state| is true, the target state is fullscreen. |
87 // Otherwise, a transition has begun to come out of fullscreen. | 91 // Otherwise, a transition has begun to come out of fullscreen. |
88 void OnFullscreenTransitionStart(bool target_fullscreen_state); | 92 void OnFullscreenTransitionStart(bool target_fullscreen_state); |
89 | 93 |
90 // Called when a fullscreen transition completes. If target_fullscreen_state() | 94 // Called when a fullscreen transition completes. If target_fullscreen_state() |
91 // does not match |actual_fullscreen_state|, a new transition will begin. | 95 // does not match |actual_fullscreen_state|, a new transition will begin. |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 void AddCompositorSuperview(); | 168 void AddCompositorSuperview(); |
165 | 169 |
166 // Size the layer to match the client area bounds, taking into account display | 170 // Size the layer to match the client area bounds, taking into account display |
167 // scale factor. | 171 // scale factor. |
168 void UpdateLayerProperties(); | 172 void UpdateLayerProperties(); |
169 | 173 |
170 // Overridden from CocoaMouseCaptureDelegate: | 174 // Overridden from CocoaMouseCaptureDelegate: |
171 void PostCapturedEvent(NSEvent* event) override; | 175 void PostCapturedEvent(NSEvent* event) override; |
172 void OnMouseCaptureLost() override; | 176 void OnMouseCaptureLost() override; |
173 | 177 |
| 178 // Returns a properties dictionary associated with the NSWindow. |
| 179 // Creates and attaches a new instance if not found. |
| 180 NSMutableDictionary* GetWindowProperties() const; |
| 181 |
174 // Overridden from FocusChangeListener: | 182 // Overridden from FocusChangeListener: |
175 void OnWillChangeFocus(View* focused_before, | 183 void OnWillChangeFocus(View* focused_before, |
176 View* focused_now) override; | 184 View* focused_now) override; |
177 void OnDidChangeFocus(View* focused_before, | 185 void OnDidChangeFocus(View* focused_before, |
178 View* focused_now) override; | 186 View* focused_now) override; |
179 | 187 |
180 // Overridden from ui::LayerDelegate: | 188 // Overridden from ui::LayerDelegate: |
181 void OnPaintLayer(gfx::Canvas* canvas) override; | 189 void OnPaintLayer(gfx::Canvas* canvas) override; |
182 void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) override; | 190 void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) override; |
183 void OnDeviceScaleFactorChanged(float device_scale_factor) override; | 191 void OnDeviceScaleFactorChanged(float device_scale_factor) override; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // If true, the window is either visible, or wants to be visible but is | 233 // If true, the window is either visible, or wants to be visible but is |
226 // currently hidden due to having a hidden parent. | 234 // currently hidden due to having a hidden parent. |
227 bool wants_to_be_visible_; | 235 bool wants_to_be_visible_; |
228 | 236 |
229 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget); | 237 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget); |
230 }; | 238 }; |
231 | 239 |
232 } // namespace views | 240 } // namespace views |
233 | 241 |
234 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ | 242 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ |
OLD | NEW |