Index: chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h |
diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h |
index 6f3f2224a9ed1e4bbdadbc6a03ecb555b591512c..c3dedbcb3b17a9f0e7e6bd78441da5e018689e7d 100644 |
--- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h |
+++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h |
@@ -7,8 +7,7 @@ |
#import <Cocoa/Cocoa.h> |
-#include "base/mac/scoped_nsobject.h" |
-#include "components/web_modal/native_web_contents_modal_dialog.h" |
+#import "chrome/browser/ui/cocoa/modal_dialog_client_cocoa.h" |
namespace content { |
class WebContents; |
@@ -26,31 +25,21 @@ class ConstrainedWindowMacDelegate { |
// Constrained window implementation for Mac. |
// Normally an instance of this class is owned by the delegate. The delegate |
// should delete the instance when the window is closed. |
-class ConstrainedWindowMac { |
+class ConstrainedWindowMac : public ModalDialogClientCocoa { |
public: |
- ConstrainedWindowMac( |
- ConstrainedWindowMacDelegate* delegate, |
- content::WebContents* web_contents, |
- id<ConstrainedWindowSheet> sheet); |
- virtual ~ConstrainedWindowMac(); |
- |
- void ShowWebContentsModalDialog(); |
- // Closes the constrained window and deletes this instance. |
+ ConstrainedWindowMac(ConstrainedWindowMacDelegate* delegate, |
+ content::WebContents* web_contents, |
+ id<ConstrainedWindowSheet> sheet); |
+ ~ConstrainedWindowMac() override; |
+ |
+ // Closes the constrained window. |
void CloseWebContentsModalDialog(); |
- void FocusWebContentsModalDialog(); |
- void PulseWebContentsModalDialog(); |
- web_modal::NativeWebContentsModalDialog GetNativeDialog(); |
+ |
+ // ModalDialogClientCocoa overrides. |
+ void OnDialogClosing() override; |
private: |
ConstrainedWindowMacDelegate* delegate_; // weak, owns us. |
- |
- // The WebContents that owns and constrains this ConstrainedWindowMac. Weak. |
- content::WebContents* web_contents_; |
- |
- base::scoped_nsprotocol<id<ConstrainedWindowSheet>> sheet_; |
- |
- // This is true if the constrained window has been shown. |
- bool shown_; |
}; |
#endif // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_MAC_ |