| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 public ui::AcceleratedWidgetMacNSView { | 43 public ui::AcceleratedWidgetMacNSView { |
| 44 public: | 44 public: |
| 45 // Ways of changing the visibility of the bridged NSWindow. | 45 // Ways of changing the visibility of the bridged NSWindow. |
| 46 enum WindowVisibilityState { | 46 enum WindowVisibilityState { |
| 47 HIDE_WINDOW, // Hides with -[NSWindow orderOut:]. | 47 HIDE_WINDOW, // Hides with -[NSWindow orderOut:]. |
| 48 SHOW_AND_ACTIVATE_WINDOW, // Shows with -[NSWindow makeKeyAndOrderFront:]. | 48 SHOW_AND_ACTIVATE_WINDOW, // Shows with -[NSWindow makeKeyAndOrderFront:]. |
| 49 SHOW_INACTIVE, // Shows with -[NSWindow orderWindow:..]. Orders | 49 SHOW_INACTIVE, // Shows with -[NSWindow orderWindow:..]. Orders |
| 50 // the window above its parent if it has one. | 50 // the window above its parent if it has one. |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 // Return the size that |window| will take for the given client area |size|, |
| 54 // based on its current style mask. |
| 55 static gfx::Size GetWindowSizeForClientSize(NSWindow* window, |
| 56 const gfx::Size& size); |
| 57 |
| 53 // Creates one side of the bridge. |parent| must not be NULL. | 58 // Creates one side of the bridge. |parent| must not be NULL. |
| 54 explicit BridgedNativeWidget(NativeWidgetMac* parent); | 59 explicit BridgedNativeWidget(NativeWidgetMac* parent); |
| 55 ~BridgedNativeWidget() override; | 60 ~BridgedNativeWidget() override; |
| 56 | 61 |
| 57 // Initialize the bridge, "retains" ownership of |window|. | 62 // Initialize the bridge, "retains" ownership of |window|. |
| 58 void Init(base::scoped_nsobject<NSWindow> window, | 63 void Init(base::scoped_nsobject<NSWindow> window, |
| 59 const Widget::InitParams& params); | 64 const Widget::InitParams& params); |
| 60 | 65 |
| 61 // Sets or clears the focus manager to use for tracking focused views. | 66 // Sets or clears the focus manager to use for tracking focused views. |
| 62 // This does NOT take ownership of |focus_manager|. | 67 // This does NOT take ownership of |focus_manager|. |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 // If true, the window is either visible, or wants to be visible but is | 253 // If true, the window is either visible, or wants to be visible but is |
| 249 // currently hidden due to having a hidden parent. | 254 // currently hidden due to having a hidden parent. |
| 250 bool wants_to_be_visible_; | 255 bool wants_to_be_visible_; |
| 251 | 256 |
| 252 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget); | 257 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget); |
| 253 }; | 258 }; |
| 254 | 259 |
| 255 } // namespace views | 260 } // namespace views |
| 256 | 261 |
| 257 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ | 262 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ |
| OLD | NEW |