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_JAVASCRIPT_APP_MODAL_DIALOG_COCOA_H_
6 #define CHROME_BROWSER_UI_COCOA_JAVASCRIPT_APP_MODAL_DIALOG_COCOA_H_
8 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h"
10 #include "base/logging.h"
11 #include "base/mac/scoped_nsobject.h"
12 #include "base/memory/scoped_ptr.h"
16 @class JavaScriptAppModalDialogHelper;
19 class JavaScriptAppModalDialogHelper;
22 class JavaScriptAppModalDialogCocoa : public NativeAppModalDialog {
24 explicit JavaScriptAppModalDialogCocoa(JavaScriptAppModalDialog* dialog);
25 virtual ~JavaScriptAppModalDialogCocoa();
27 // Overridden from NativeAppModalDialog:
28 virtual int GetAppModalDialogButtons() const OVERRIDE;
29 virtual void ShowAppModalDialog() OVERRIDE;
30 virtual void ActivateAppModalDialog() OVERRIDE;
31 virtual void CloseAppModalDialog() OVERRIDE;
32 virtual void AcceptAppModalDialog() OVERRIDE;
33 virtual void CancelAppModalDialog() OVERRIDE;
35 JavaScriptAppModalDialog* dialog() const { return dialog_.get(); }
38 // Returns the NSAlert associated with the modal dialog.
39 NSAlert* GetAlert() const;
41 scoped_ptr<JavaScriptAppModalDialog> dialog_;
43 // Created in the constructor and destroyed in the destructor.
44 base::scoped_nsobject<JavaScriptAppModalDialogHelper> helper_;
46 DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialogCocoa);
49 #endif // CHROME_BROWSER_UI_COCOA_JAVASCRIPT_APP_MODAL_DIALOG_COCOA_H_