| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_ |
| 6 #define CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_ | 6 #define CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // Constrained window implementation for Mac. | 24 // Constrained window implementation for Mac. |
| 25 // Normally an instance of this class is owned by the delegate. The delegate | 25 // Normally an instance of this class is owned by the delegate. The delegate |
| 26 // should delete the instance when the window is closed. | 26 // should delete the instance when the window is closed. |
| 27 class ConstrainedWindowMac { | 27 class ConstrainedWindowMac { |
| 28 public: | 28 public: |
| 29 ConstrainedWindowMac(ConstrainedWindowMacDelegate* delegate, | 29 ConstrainedWindowMac(ConstrainedWindowMacDelegate* delegate, |
| 30 content::WebContents* web_contents, | 30 content::WebContents* web_contents, |
| 31 id<ConstrainedWindowSheet> sheet); | 31 id<ConstrainedWindowSheet> sheet); |
| 32 ~ConstrainedWindowMac(); | 32 ~ConstrainedWindowMac(); |
| 33 | 33 |
| 34 // Indicates if the dialog can be successfully shown. |
| 35 // TODO(davidben): Remove this when the certificate selector prompt is moved |
| 36 // to the WebContentsDelegate. https://crbug.com/456255. |
| 37 static bool HasTopLevelDialogManager(content::WebContents* web_contents); |
| 38 |
| 34 // Closes the constrained window. | 39 // Closes the constrained window. |
| 35 void CloseWebContentsModalDialog(); | 40 void CloseWebContentsModalDialog(); |
| 36 | 41 |
| 37 SingleWebContentsDialogManagerCocoa* manager() const { return manager_; } | 42 SingleWebContentsDialogManagerCocoa* manager() const { return manager_; } |
| 38 void set_manager(SingleWebContentsDialogManagerCocoa* manager) { | 43 void set_manager(SingleWebContentsDialogManagerCocoa* manager) { |
| 39 manager_ = manager; | 44 manager_ = manager; |
| 40 } | 45 } |
| 41 | 46 |
| 42 // Called by |manager_| when the dialog is closing. | 47 // Called by |manager_| when the dialog is closing. |
| 43 void OnDialogClosing(); | 48 void OnDialogClosing(); |
| 44 | 49 |
| 45 private: | 50 private: |
| 46 ConstrainedWindowMacDelegate* delegate_; // weak, owns us. | 51 ConstrainedWindowMacDelegate* delegate_; // weak, owns us. |
| 47 SingleWebContentsDialogManagerCocoa* manager_; // weak, owned by WCMDM. | 52 SingleWebContentsDialogManagerCocoa* manager_; // weak, owned by WCMDM. |
| 48 }; | 53 }; |
| 49 | 54 |
| 50 #endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_ | 55 #endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_ |
| OLD | NEW |