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 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #import "base/mac/scoped_nsobject.h" | 13 #import "base/mac/scoped_nsobject.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #import "ui/accelerated_widget_mac/accelerated_widget_mac.h" | 15 #import "ui/accelerated_widget_mac/accelerated_widget_mac.h" |
16 #include "ui/base/ime/input_method_delegate.h" | 16 #include "ui/base/ime/input_method_delegate.h" |
17 #include "ui/compositor/layer_owner.h" | 17 #include "ui/compositor/layer_owner.h" |
18 #import "ui/views/cocoa/bridged_native_widget_owner.h" | 18 #import "ui/views/cocoa/bridged_native_widget_owner.h" |
19 #import "ui/views/cocoa/cocoa_mouse_capture_delegate.h" | 19 #import "ui/views/cocoa/cocoa_mouse_capture_delegate.h" |
| 20 #import "ui/views/cocoa/cocoa_drag_drop_manager.h" |
20 #import "ui/views/focus/focus_manager.h" | 21 #import "ui/views/focus/focus_manager.h" |
21 #include "ui/views/views_export.h" | 22 #include "ui/views/views_export.h" |
22 #include "ui/views/widget/widget.h" | 23 #include "ui/views/widget/widget.h" |
23 | 24 |
24 @class BridgedContentView; | 25 @class BridgedContentView; |
25 @class ViewsNSWindowDelegate; | 26 @class ViewsNSWindowDelegate; |
26 | 27 |
27 namespace ui { | 28 namespace ui { |
28 class InputMethod; | 29 class InputMethod; |
29 } | 30 } |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 void ClearAssociationForView(const views::View* view); | 165 void ClearAssociationForView(const views::View* view); |
165 // Sorts child NSViews according to NativeViewHosts order in views hierarchy. | 166 // Sorts child NSViews according to NativeViewHosts order in views hierarchy. |
166 void ReorderChildViews(); | 167 void ReorderChildViews(); |
167 | 168 |
168 NativeWidgetMac* native_widget_mac() { return native_widget_mac_; } | 169 NativeWidgetMac* native_widget_mac() { return native_widget_mac_; } |
169 BridgedContentView* ns_view() { return bridged_view_; } | 170 BridgedContentView* ns_view() { return bridged_view_; } |
170 NSWindow* ns_window() { return window_; } | 171 NSWindow* ns_window() { return window_; } |
171 | 172 |
172 TooltipManager* tooltip_manager() { return tooltip_manager_.get(); } | 173 TooltipManager* tooltip_manager() { return tooltip_manager_.get(); } |
173 | 174 |
| 175 CocoaDragDropManager* drag_drop_manager() { return drag_drop_manager_.get(); } |
| 176 |
174 // The parent widget specified in Widget::InitParams::parent. If non-null, the | 177 // The parent widget specified in Widget::InitParams::parent. If non-null, the |
175 // parent will close children before the parent closes, and children will be | 178 // parent will close children before the parent closes, and children will be |
176 // raised above their parent when window z-order changes. | 179 // raised above their parent when window z-order changes. |
177 BridgedNativeWidgetOwner* parent() { return parent_; } | 180 BridgedNativeWidgetOwner* parent() { return parent_; } |
178 const std::vector<BridgedNativeWidget*>& child_windows() { | 181 const std::vector<BridgedNativeWidget*>& child_windows() { |
179 return child_windows_; | 182 return child_windows_; |
180 } | 183 } |
181 | 184 |
182 bool target_fullscreen_state() const { return target_fullscreen_state_; } | 185 bool target_fullscreen_state() const { return target_fullscreen_state_; } |
183 bool window_visible() { return window_visible_; } | 186 bool window_visible() { return window_visible_; } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 bool IsVisibleParent() const override; | 259 bool IsVisibleParent() const override; |
257 void RemoveChildWindow(BridgedNativeWidget* child) override; | 260 void RemoveChildWindow(BridgedNativeWidget* child) override; |
258 | 261 |
259 views::NativeWidgetMac* native_widget_mac_; // Weak. Owns this. | 262 views::NativeWidgetMac* native_widget_mac_; // Weak. Owns this. |
260 base::scoped_nsobject<NSWindow> window_; | 263 base::scoped_nsobject<NSWindow> window_; |
261 base::scoped_nsobject<ViewsNSWindowDelegate> window_delegate_; | 264 base::scoped_nsobject<ViewsNSWindowDelegate> window_delegate_; |
262 base::scoped_nsobject<BridgedContentView> bridged_view_; | 265 base::scoped_nsobject<BridgedContentView> bridged_view_; |
263 std::unique_ptr<ui::InputMethod> input_method_; | 266 std::unique_ptr<ui::InputMethod> input_method_; |
264 std::unique_ptr<CocoaMouseCapture> mouse_capture_; | 267 std::unique_ptr<CocoaMouseCapture> mouse_capture_; |
265 std::unique_ptr<TooltipManager> tooltip_manager_; | 268 std::unique_ptr<TooltipManager> tooltip_manager_; |
| 269 std::unique_ptr<CocoaDragDropManager> drag_drop_manager_; |
266 FocusManager* focus_manager_; // Weak. Owned by our Widget. | 270 FocusManager* focus_manager_; // Weak. Owned by our Widget. |
267 Widget::InitParams::Type widget_type_; | 271 Widget::InitParams::Type widget_type_; |
268 | 272 |
269 BridgedNativeWidgetOwner* parent_; // Weak. If non-null, owns this. | 273 BridgedNativeWidgetOwner* parent_; // Weak. If non-null, owns this. |
270 std::vector<BridgedNativeWidget*> child_windows_; | 274 std::vector<BridgedNativeWidget*> child_windows_; |
271 | 275 |
272 base::scoped_nsobject<NSView> compositor_superview_; | 276 base::scoped_nsobject<NSView> compositor_superview_; |
273 std::unique_ptr<ui::AcceleratedWidgetMac> compositor_widget_; | 277 std::unique_ptr<ui::AcceleratedWidgetMac> compositor_widget_; |
274 std::unique_ptr<ui::Compositor> compositor_; | 278 std::unique_ptr<ui::Compositor> compositor_; |
275 | 279 |
(...skipping 23 matching lines...) Expand all Loading... |
299 bool invalidate_shadow_on_frame_swap_ = false; | 303 bool invalidate_shadow_on_frame_swap_ = false; |
300 | 304 |
301 AssociatedViews associated_views_; | 305 AssociatedViews associated_views_; |
302 | 306 |
303 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget); | 307 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget); |
304 }; | 308 }; |
305 | 309 |
306 } // namespace views | 310 } // namespace views |
307 | 311 |
308 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ | 312 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ |
OLD | NEW |