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

Unified Diff: chrome/browser/ui/cocoa/constrained_window_mac.h

Issue 10823176: Cocoa: Support constrained windows for platform apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 8 years, 4 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: chrome/browser/ui/cocoa/constrained_window_mac.h
diff --git a/chrome/browser/ui/cocoa/constrained_window_mac.h b/chrome/browser/ui/cocoa/constrained_window_mac.h
index 50daeeda2f40d9d5981a1c86db2f49b5323f9eb9..c2b37967940afcdc837eed1fe2f3478bf1c19513 100644
--- a/chrome/browser/ui/cocoa/constrained_window_mac.h
+++ b/chrome/browser/ui/cocoa/constrained_window_mac.h
@@ -12,12 +12,28 @@
#include "base/memory/scoped_nsobject.h"
#include "chrome/browser/ui/constrained_window.h"
-@class BrowserWindowController;
+class ConstrainedWindowMac;
@class GTMWindowSheetController;
@class NSView;
@class NSWindow;
class TabContents;
+// Window controllers that allow hosting constrained windows should
+// implement this protocol.
+@protocol ConstrainedWindowSupport
+
+// Requests that |window| is opened as a per-tab sheet to the current tab.
+- (void)attachConstrainedWindow:(ConstrainedWindowMac*)window;
+
+// Closes the tab sheet |window| and potentially shows the next sheet in the
+// tab's sheet queue.
+- (void)removeConstrainedWindow:(ConstrainedWindowMac*)window;
+
+// Returns NO if constrained windows cannot be attached to this window.
+- (BOOL)canAttachConstrainedWindow;
+
+@end
+
// Base class for constrained dialog delegates. Never inherit from this
// directly.
class ConstrainedWindowMacDelegate {
@@ -124,7 +140,7 @@ class ConstrainedWindowMac : public ConstrainedWindow {
ConstrainedWindowMacDelegate* delegate() { return delegate_; }
// Makes the constrained window visible, if it is not yet visible.
- void Realize(BrowserWindowController* controller);
+ void Realize(NSWindowController<ConstrainedWindowSupport>* controller);
private:
friend class ConstrainedWindow;
@@ -136,7 +152,7 @@ class ConstrainedWindowMac : public ConstrainedWindow {
ConstrainedWindowMacDelegate* delegate_;
// Controller of the window that contains this sheet.
- BrowserWindowController* controller_;
+ NSWindowController<ConstrainedWindowSupport>* controller_;
// Stores if |ShowConstrainedWindow()| was called.
bool should_be_visible_;

Powered by Google App Engine
This is Rietveld 408576698