| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // fullscreen or transitioning between fullscreen states. | 143 // fullscreen or transitioning between fullscreen states. |
| 144 gfx::Rect GetRestoredBounds() const; | 144 gfx::Rect GetRestoredBounds() const; |
| 145 | 145 |
| 146 // Creates a ui::Compositor which becomes responsible for drawing the window. | 146 // Creates a ui::Compositor which becomes responsible for drawing the window. |
| 147 void CreateLayer(ui::LayerType layer_type, bool translucent); | 147 void CreateLayer(ui::LayerType layer_type, bool translucent); |
| 148 | 148 |
| 149 NativeWidgetMac* native_widget_mac() { return native_widget_mac_; } | 149 NativeWidgetMac* native_widget_mac() { return native_widget_mac_; } |
| 150 BridgedContentView* ns_view() { return bridged_view_; } | 150 BridgedContentView* ns_view() { return bridged_view_; } |
| 151 NSWindow* ns_window() { return window_; } | 151 NSWindow* ns_window() { return window_; } |
| 152 | 152 |
| 153 TooltipManager* tooltip_manager() { return tooltip_manager_.get(); } |
| 154 |
| 153 // The parent widget specified in Widget::InitParams::parent. If non-null, the | 155 // The parent widget specified in Widget::InitParams::parent. If non-null, the |
| 154 // parent will close children before the parent closes, and children will be | 156 // parent will close children before the parent closes, and children will be |
| 155 // raised above their parent when window z-order changes. | 157 // raised above their parent when window z-order changes. |
| 156 BridgedNativeWidgetOwner* parent() { return parent_; } | 158 BridgedNativeWidgetOwner* parent() { return parent_; } |
| 157 const std::vector<BridgedNativeWidget*>& child_windows() { | 159 const std::vector<BridgedNativeWidget*>& child_windows() { |
| 158 return child_windows_; | 160 return child_windows_; |
| 159 } | 161 } |
| 160 | 162 |
| 161 bool target_fullscreen_state() const { return target_fullscreen_state_; } | 163 bool target_fullscreen_state() const { return target_fullscreen_state_; } |
| 162 bool window_visible() { return window_visible_; } | 164 bool window_visible() { return window_visible_; } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 gfx::Vector2d GetChildWindowOffset() const override; | 223 gfx::Vector2d GetChildWindowOffset() const override; |
| 222 bool IsVisibleParent() const override; | 224 bool IsVisibleParent() const override; |
| 223 void RemoveChildWindow(BridgedNativeWidget* child) override; | 225 void RemoveChildWindow(BridgedNativeWidget* child) override; |
| 224 | 226 |
| 225 views::NativeWidgetMac* native_widget_mac_; // Weak. Owns this. | 227 views::NativeWidgetMac* native_widget_mac_; // Weak. Owns this. |
| 226 base::scoped_nsobject<NSWindow> window_; | 228 base::scoped_nsobject<NSWindow> window_; |
| 227 base::scoped_nsobject<ViewsNSWindowDelegate> window_delegate_; | 229 base::scoped_nsobject<ViewsNSWindowDelegate> window_delegate_; |
| 228 base::scoped_nsobject<BridgedContentView> bridged_view_; | 230 base::scoped_nsobject<BridgedContentView> bridged_view_; |
| 229 scoped_ptr<ui::InputMethod> input_method_; | 231 scoped_ptr<ui::InputMethod> input_method_; |
| 230 scoped_ptr<CocoaMouseCapture> mouse_capture_; | 232 scoped_ptr<CocoaMouseCapture> mouse_capture_; |
| 233 scoped_ptr<TooltipManager> tooltip_manager_; |
| 231 FocusManager* focus_manager_; // Weak. Owned by our Widget. | 234 FocusManager* focus_manager_; // Weak. Owned by our Widget. |
| 232 Widget::InitParams::Type widget_type_; | 235 Widget::InitParams::Type widget_type_; |
| 233 | 236 |
| 234 BridgedNativeWidgetOwner* parent_; // Weak. If non-null, owns this. | 237 BridgedNativeWidgetOwner* parent_; // Weak. If non-null, owns this. |
| 235 std::vector<BridgedNativeWidget*> child_windows_; | 238 std::vector<BridgedNativeWidget*> child_windows_; |
| 236 | 239 |
| 237 base::scoped_nsobject<NSView> compositor_superview_; | 240 base::scoped_nsobject<NSView> compositor_superview_; |
| 238 scoped_ptr<ui::AcceleratedWidgetMac> compositor_widget_; | 241 scoped_ptr<ui::AcceleratedWidgetMac> compositor_widget_; |
| 239 scoped_ptr<ui::Compositor> compositor_; | 242 scoped_ptr<ui::Compositor> compositor_; |
| 240 | 243 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 258 // If true, the window is either visible, or wants to be visible but is | 261 // If true, the window is either visible, or wants to be visible but is |
| 259 // currently hidden due to having a hidden parent. | 262 // currently hidden due to having a hidden parent. |
| 260 bool wants_to_be_visible_; | 263 bool wants_to_be_visible_; |
| 261 | 264 |
| 262 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget); | 265 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget); |
| 263 }; | 266 }; |
| 264 | 267 |
| 265 } // namespace views | 268 } // namespace views |
| 266 | 269 |
| 267 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ | 270 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ |
| OLD | NEW |