Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
|
tapted
2016/03/17 08:18:58
CL description: perhaps something like `Implement
| |
| 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 <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #import "base/mac/scoped_nsobject.h" | 12 #import "base/mac/scoped_nsobject.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.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/focus/focus_manager.h" | 20 #import "ui/views/focus/focus_manager.h" |
| 21 #include "ui/views/views_export.h" | 21 #include "ui/views/views_export.h" |
| 22 #include "ui/views/widget/widget.h" | 22 #include "ui/views/widget/widget.h" |
| 23 #include "ui/views/widget/widget_mac_utils.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 } |
| 30 | 31 |
| 31 namespace views { | 32 namespace views { |
| 32 namespace test { | 33 namespace test { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 // See widget.h for documentation. | 150 // See widget.h for documentation. |
| 150 ui::InputMethod* GetInputMethod(); | 151 ui::InputMethod* GetInputMethod(); |
| 151 | 152 |
| 152 // The restored bounds will be derived from the current NSWindow frame unless | 153 // The restored bounds will be derived from the current NSWindow frame unless |
| 153 // fullscreen or transitioning between fullscreen states. | 154 // fullscreen or transitioning between fullscreen states. |
| 154 gfx::Rect GetRestoredBounds() const; | 155 gfx::Rect GetRestoredBounds() const; |
| 155 | 156 |
| 156 // Creates a ui::Compositor which becomes responsible for drawing the window. | 157 // Creates a ui::Compositor which becomes responsible for drawing the window. |
| 157 void CreateLayer(ui::LayerType layer_type, bool translucent); | 158 void CreateLayer(ui::LayerType layer_type, bool translucent); |
| 158 | 159 |
| 160 // Updates associated_views_ on NativeViewHost::Attach/Detach | |
|
tapted
2016/03/17 08:18:58
nit: .. |associated_views_| .. NativeViewHost::Att
| |
| 161 void SetAssociationForView(const views::View* view, NSView* native_view); | |
| 162 void ClearAssociationForView(const views::View* view); | |
| 163 void ReorderChildViews(); | |
|
tapted
2016/03/17 08:18:58
This should have a separate comment
| |
| 164 | |
| 159 NativeWidgetMac* native_widget_mac() { return native_widget_mac_; } | 165 NativeWidgetMac* native_widget_mac() { return native_widget_mac_; } |
| 160 BridgedContentView* ns_view() { return bridged_view_; } | 166 BridgedContentView* ns_view() { return bridged_view_; } |
| 161 NSWindow* ns_window() { return window_; } | 167 NSWindow* ns_window() { return window_; } |
| 162 | 168 |
| 163 TooltipManager* tooltip_manager() { return tooltip_manager_.get(); } | 169 TooltipManager* tooltip_manager() { return tooltip_manager_.get(); } |
| 164 | 170 |
| 165 // The parent widget specified in Widget::InitParams::parent. If non-null, the | 171 // The parent widget specified in Widget::InitParams::parent. If non-null, the |
| 166 // parent will close children before the parent closes, and children will be | 172 // parent will close children before the parent closes, and children will be |
| 167 // raised above their parent when window z-order changes. | 173 // raised above their parent when window z-order changes. |
| 168 BridgedNativeWidgetOwner* parent() { return parent_; } | 174 BridgedNativeWidgetOwner* parent() { return parent_; } |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 282 bool window_visible_; | 288 bool window_visible_; |
| 283 | 289 |
| 284 // If true, the window is either visible, or wants to be visible but is | 290 // If true, the window is either visible, or wants to be visible but is |
| 285 // currently hidden due to having a hidden parent. | 291 // currently hidden due to having a hidden parent. |
| 286 bool wants_to_be_visible_; | 292 bool wants_to_be_visible_; |
| 287 | 293 |
| 288 // If true, the window has been made visible or changed shape and the window | 294 // If true, the window has been made visible or changed shape and the window |
| 289 // shadow needs to be invalidated when a frame is received for the new shape. | 295 // shadow needs to be invalidated when a frame is received for the new shape. |
| 290 bool invalidate_shadow_on_frame_swap_ = false; | 296 bool invalidate_shadow_on_frame_swap_ = false; |
| 291 | 297 |
| 298 // Contains NativeViewHost->gfx::NativeView associations. | |
| 299 views::AssociatedViews associated_views_; | |
| 300 | |
| 292 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget); | 301 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget); |
| 293 }; | 302 }; |
| 294 | 303 |
| 295 } // namespace views | 304 } // namespace views |
| 296 | 305 |
| 297 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ | 306 #endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_H_ |
| OLD | NEW |