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

Unified Diff: ui/views/cocoa/bridged_native_widget_owner.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
Index: ui/views/cocoa/bridged_native_widget_owner.h
diff --git a/ui/views/cocoa/bridged_native_widget_owner.h b/ui/views/cocoa/bridged_native_widget_owner.h
new file mode 100644
index 0000000000000000000000000000000000000000..ba8cd1af1d7d1b5064e3ffba90595f5382aeb5ae
--- /dev/null
+++ b/ui/views/cocoa/bridged_native_widget_owner.h
@@ -0,0 +1,44 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_OWNER_H_
+#define UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_OWNER_H_
+
+namespace gfx {
+class Vector2d;
+}
+
+@class NSWindow;
+
+namespace views {
+
+class BridgedNativeWidget;
+
+// An abstract interface wrapping an NSWindow that ties the lifetime of one or
+// more child BridgedNativeWidgets to the lifetime of that NSWindow. This is not
+// simply an NSWindow, because the child window API provided by NSWindow
+// requires child windows to always be visible.
+class BridgedNativeWidgetOwner {
+ public:
+ // The NSWindow parent.
+ virtual NSWindow* GetNSWindow() = 0;
Andre 2015/05/07 17:32:37 const? (also ChildWIndowOffset and IsVisibleParent
tapted 2015/05/07 23:43:50 Done.
+
+ // The offset in screen pixels for positioning child windows owned by |this|.
+ virtual gfx::Vector2d ChildWindowOffset() = 0;
Andre 2015/05/07 17:32:37 How about GetChildWindowOffset? Use of Get prefix
tapted 2015/05/07 23:43:50 Done.
+
+ // Return false if |this| is hidden, or has a hidden ancestor.
+ virtual bool IsVisibleParent() = 0;
+
+ // Removes a child window. Note |this| may be deleted after calling, so the
+ // caller should immediately null out the pointer used to make the call.
+ virtual void RemoveChildWindow(BridgedNativeWidget* child) = 0;
+
+ protected:
+ // Instances of this class may be self-deleting.
+ virtual ~BridgedNativeWidgetOwner() {}
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_COCOA_BRIDGED_NATIVE_WIDGET_OWNER_H_

Powered by Google App Engine
This is Rietveld 408576698