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

Unified Diff: ui/views/cocoa/bridged_native_widget.h

Issue 1063933003: MacViews: Allow views::Widgets to be parented off NSWindows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150401-MacViews-AppInfo-Standalone
Patch Set: fix gyp Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/cocoa/bridged_native_widget.mm » ('j') | ui/views/cocoa/bridged_native_widget.mm » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/bridged_native_widget.h
diff --git a/ui/views/cocoa/bridged_native_widget.h b/ui/views/cocoa/bridged_native_widget.h
index 149c5377d0be80bcdd347bcd7720f1ffbd2ef28b..435cef4dbbff69d9efb9ef710643ea4b88699a19 100644
--- a/ui/views/cocoa/bridged_native_widget.h
+++ b/ui/views/cocoa/bridged_native_widget.h
@@ -12,6 +12,7 @@
#include "base/memory/scoped_ptr.h"
#include "ui/compositor/layer_owner.h"
#import "ui/accelerated_widget_mac/accelerated_widget_mac.h"
+#import "ui/views/cocoa/bridged_native_widget_owner.h"
#import "ui/views/cocoa/cocoa_mouse_capture_delegate.h"
#import "ui/views/focus/focus_manager.h"
#include "ui/views/ime/input_method_delegate.h"
@@ -40,7 +41,8 @@ class VIEWS_EXPORT BridgedNativeWidget : public ui::LayerDelegate,
public internal::InputMethodDelegate,
public CocoaMouseCaptureDelegate,
public FocusChangeListener,
- public ui::AcceleratedWidgetMacNSView {
+ public ui::AcceleratedWidgetMacNSView,
+ public BridgedNativeWidgetOwner {
public:
// Ways of changing the visibility of the bridged NSWindow.
enum WindowVisibilityState {
@@ -151,7 +153,7 @@ class VIEWS_EXPORT BridgedNativeWidget : public ui::LayerDelegate,
// The parent widget specified in Widget::InitParams::parent. If non-null, the
// parent will close children before the parent closes, and children will be
// raised above their parent when window z-order changes.
- BridgedNativeWidget* parent() { return parent_; }
+ BridgedNativeWidgetOwner* parent() { return parent_; }
const std::vector<BridgedNativeWidget*>& child_windows() {
return child_windows_;
}
@@ -166,9 +168,6 @@ class VIEWS_EXPORT BridgedNativeWidget : public ui::LayerDelegate,
// Closes all child windows. BridgedNativeWidget children will be destroyed.
void RemoveOrDestroyChildren();
- // Remove the given |child| from |child_windows_|.
- void RemoveChildWindow(BridgedNativeWidget* child);
-
// Notify descendants of a visibility change.
void NotifyVisibilityChangeDown();
@@ -217,6 +216,12 @@ class VIEWS_EXPORT BridgedNativeWidget : public ui::LayerDelegate,
const std::vector<ui::LatencyInfo>& latency_info) override;
void AcceleratedWidgetHitError() override;
+ // Overridden from BridgedNativeWidgetOwner:
+ NSWindow* GetNSWindow() override;
+ gfx::Vector2d ChildWindowOffset() override;
+ bool IsVisibleParent() override;
+ void RemoveChildWindow(BridgedNativeWidget* child) override;
+
views::NativeWidgetMac* native_widget_mac_; // Weak. Owns this.
base::scoped_nsobject<NSWindow> window_;
base::scoped_nsobject<ViewsNSWindowDelegate> window_delegate_;
@@ -226,7 +231,7 @@ class VIEWS_EXPORT BridgedNativeWidget : public ui::LayerDelegate,
FocusManager* focus_manager_; // Weak. Owned by our Widget.
Widget::InitParams::Type widget_type_;
- BridgedNativeWidget* parent_; // Weak. If non-null, owns this.
+ BridgedNativeWidgetOwner* parent_; // Weak. If non-null, owns this.
std::vector<BridgedNativeWidget*> child_windows_;
base::scoped_nsobject<NSView> compositor_superview_;
« no previous file with comments | « no previous file | ui/views/cocoa/bridged_native_widget.mm » ('j') | ui/views/cocoa/bridged_native_widget.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698