1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_
6 #define CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_
8 #import <Cocoa/Cocoa.h>
13 class ConstrainedWindowMac
;
14 class SingleWebContentsDialogManagerCocoa
;
15 @protocol ConstrainedWindowSheet
;
17 // A delegate for a constrained window. The delegate is notified when the
19 class ConstrainedWindowMacDelegate
{
21 virtual void OnConstrainedWindowClosed(ConstrainedWindowMac
* window
) = 0;
24 // Constrained window implementation for Mac.
25 // Normally an instance of this class is owned by the delegate. The delegate
26 // should delete the instance when the window is closed.
27 class ConstrainedWindowMac
{
29 ConstrainedWindowMac(ConstrainedWindowMacDelegate
* delegate
,
30 content::WebContents
* web_contents
,
31 id
<ConstrainedWindowSheet
> sheet
);
32 ~ConstrainedWindowMac();
34 // Closes the constrained window.
35 void CloseWebContentsModalDialog();
37 SingleWebContentsDialogManagerCocoa
* manager() const { return manager_
; }
38 void set_manager(SingleWebContentsDialogManagerCocoa
* manager
) {
42 // Called by |manager_| when the dialog is closing.
43 void OnDialogClosing();
46 ConstrainedWindowMacDelegate
* delegate_
; // weak, owns us.
47 SingleWebContentsDialogManagerCocoa
* manager_
; // weak, owned by WCMDM.
50 #endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_