summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/cocoa/constrained_window_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/cocoa/constrained_window_mac.mm')
-rw-r--r--chrome/browser/ui/cocoa/constrained_window_mac.mm44
1 files changed, 43 insertions, 1 deletions
diff --git a/chrome/browser/ui/cocoa/constrained_window_mac.mm b/chrome/browser/ui/cocoa/constrained_window_mac.mm
index 9c408a0..c8b9965 100644
--- a/chrome/browser/ui/cocoa/constrained_window_mac.mm
+++ b/chrome/browser/ui/cocoa/constrained_window_mac.mm
@@ -9,7 +9,18 @@
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
#import "third_party/GTM/AppKit/GTMWindowSheetController.h"
-ConstrainedWindowMacDelegate::~ConstrainedWindowMacDelegate() {}
+ConstrainedWindowMacDelegateSystemSheet::
+ConstrainedWindowMacDelegateSystemSheet(id delegate, SEL didEndSelector)
+ : systemSheet_(nil),
+ delegate_([delegate retain]),
+ didEndSelector_(didEndSelector) {}
+
+ConstrainedWindowMacDelegateSystemSheet::
+ ~ConstrainedWindowMacDelegateSystemSheet() {}
+
+void ConstrainedWindowMacDelegateSystemSheet::set_sheet(id sheet) {
+ systemSheet_.reset([sheet retain]);
+}
NSArray* ConstrainedWindowMacDelegateSystemSheet::GetSheetParameters(
id delegate,
@@ -31,6 +42,37 @@ void ConstrainedWindowMacDelegateSystemSheet::RunSheet(
withParameters:params];
}
+ConstrainedWindowMacDelegateCustomSheet::
+ConstrainedWindowMacDelegateCustomSheet()
+ : customSheet_(nil),
+ delegate_(nil),
+ didEndSelector_(NULL) {}
+
+ConstrainedWindowMacDelegateCustomSheet::
+ConstrainedWindowMacDelegateCustomSheet(id delegate, SEL didEndSelector)
+ : customSheet_(nil),
+ delegate_([delegate retain]),
+ didEndSelector_(didEndSelector) {}
+
+ConstrainedWindowMacDelegateCustomSheet::
+~ConstrainedWindowMacDelegateCustomSheet() {}
+
+void ConstrainedWindowMacDelegateCustomSheet::init(NSWindow* sheet,
+ id delegate,
+ SEL didEndSelector) {
+ DCHECK(!delegate_.get());
+ DCHECK(!didEndSelector_);
+ customSheet_.reset([sheet retain]);
+ delegate_.reset([delegate retain]);
+ didEndSelector_ = didEndSelector;
+ DCHECK(delegate_.get());
+ DCHECK(didEndSelector_);
+ }
+
+void ConstrainedWindowMacDelegateCustomSheet::set_sheet(NSWindow* sheet) {
+ customSheet_.reset([sheet retain]);
+}
+
void ConstrainedWindowMacDelegateCustomSheet::RunSheet(
GTMWindowSheetController* sheetController,
NSView* view) {