Chromium Code Reviews| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 by ViewsNSWindowDelegate when the application receives a mouse-down, | |
|
tapted
2015/05/25 05:24:05
nit: "Called by the NSWindowDelegate" for consiste
jackhou1
2015/05/25 06:26:39
Done.
| |
| 136 // but before the event is processed by NSWindows. Returning true here will | |
| 137 // cause the event to be cancelled and reposted at the CGSessionEventTap | |
| 138 // level. This is used to determine whether a mouse-down should drag the | |
| 139 // window. | |
| 140 bool ShouldRepostPendingLeftMouseDown(NSPoint location_in_window); | |
| 141 | |
| 135 // Called by NativeWidgetMac when the window size constraints change. | 142 // Called by NativeWidgetMac when the window size constraints change. |
| 136 void OnSizeConstraintsChanged(); | 143 void OnSizeConstraintsChanged(); |
| 137 | 144 |
| 138 // See widget.h for documentation. | 145 // See widget.h for documentation. |
| 139 InputMethod* CreateInputMethod(); | 146 InputMethod* CreateInputMethod(); |
| 140 ui::InputMethod* GetHostInputMethod(); | 147 ui::InputMethod* GetHostInputMethod(); |
| 141 | 148 |
| 142 // The restored bounds will be derived from the current NSWindow frame unless | 149 // The restored bounds will be derived from the current NSWindow frame unless |
| 143 // fullscreen or transitioning between fullscreen states. | 150 // fullscreen or transitioning between fullscreen states. |
| 144 gfx::Rect GetRestoredBounds() const; | 151 gfx::Rect GetRestoredBounds() const; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 184 void DestroyCompositor(); | 191 void DestroyCompositor(); |
| 185 | 192 |
| 186 // Installs the NSView for hosting the composited layer. It is later provided | 193 // Installs the NSView for hosting the composited layer. It is later provided |
| 187 // to |compositor_widget_| via AcceleratedWidgetGetNSView(). | 194 // to |compositor_widget_| via AcceleratedWidgetGetNSView(). |
| 188 void AddCompositorSuperview(); | 195 void AddCompositorSuperview(); |
| 189 | 196 |
| 190 // Size the layer to match the client area bounds, taking into account display | 197 // Size the layer to match the client area bounds, taking into account display |
| 191 // scale factor. | 198 // scale factor. |
| 192 void UpdateLayerProperties(); | 199 void UpdateLayerProperties(); |
| 193 | 200 |
| 201 // Sets mouseDownCanMoveWindow on |bridged_view_| and triggers the NSWindow to | |
| 202 // update its draggable region. | |
| 203 void SetDraggable(bool draggable); | |
| 204 | |
| 194 // Overridden from CocoaMouseCaptureDelegate: | 205 // Overridden from CocoaMouseCaptureDelegate: |
| 195 void PostCapturedEvent(NSEvent* event) override; | 206 void PostCapturedEvent(NSEvent* event) override; |
| 196 void OnMouseCaptureLost() override; | 207 void OnMouseCaptureLost() override; |
| 197 | 208 |
| 198 // Returns a properties dictionary associated with the NSWindow. | 209 // Returns a properties dictionary associated with the NSWindow. |
| 199 // Creates and attaches a new instance if not found. | 210 // Creates and attaches a new instance if not found. |
| 200 NSMutableDictionary* GetWindowProperties() const; | 211 NSMutableDictionary* GetWindowProperties() const; |
| 201 | 212 |
| 202 // Overridden from FocusChangeListener: | 213 // Overridden from FocusChangeListener: |
| 203 void OnWillChangeFocus(View* focused_before, | 214 void OnWillChangeFocus(View* focused_before, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 261 // If true, the window is either visible, or wants to be visible but is | 272 // If true, the window is either visible, or wants to be visible but is |
| 262 // currently hidden due to having a hidden parent. | 273 // currently hidden due to having a hidden parent. |
| 263 bool wants_to_be_visible_; | 274 bool wants_to_be_visible_; |
| 264 | 275 |
| 265 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget); | 276 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget); |
| 266 }; | 277 }; |
| 267 | 278 |
| 268 } // namespace views | 279 } // namespace views |
| 269 | 280 |
| 270 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ | 281 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ |
| OLD | NEW |