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

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

Issue 1964283002: MacViews: Implemented Drag & Drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for dcheng Created 4 years, 6 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
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 <memory> 10 #include <memory>
(...skipping 16 matching lines...) Expand all
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 } 34 }
35 35
36 class CocoaMouseCapture; 36 class CocoaMouseCapture;
37 class DragDropClientMac;
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
44 : public ui::LayerDelegate, 45 : public ui::LayerDelegate,
45 public ui::LayerOwner, 46 public ui::LayerOwner,
46 public ui::internal::InputMethodDelegate, 47 public ui::internal::InputMethodDelegate,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 DragDropClientMac* drag_drop_client() { return drag_drop_client_.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
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<DragDropClientMac> drag_drop_client_;
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698