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 "base/logging.h"
9 #include "base/mac/scoped_nsobject.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "components/app_modal/native_app_modal_dialog.h"
13 class AppModalDialogHelper
;
17 @
class JavaScriptAppModalDialogHelper
;
20 class JavaScriptAppModalDialogHelper
;
23 class JavaScriptAppModalDialogCocoa
: public app_modal::NativeAppModalDialog
{
25 explicit JavaScriptAppModalDialogCocoa(
26 app_modal::JavaScriptAppModalDialog
* dialog
);
27 ~JavaScriptAppModalDialogCocoa() override
;
29 // Overridden from NativeAppModalDialog:
30 int GetAppModalDialogButtons() const override
;
31 void ShowAppModalDialog() override
;
32 void ActivateAppModalDialog() override
;
33 void CloseAppModalDialog() override
;
34 void AcceptAppModalDialog() override
;
35 void CancelAppModalDialog() override
;
36 bool IsShowing() const override
;
38 app_modal::JavaScriptAppModalDialog
* dialog() const {
43 // Returns the NSAlert associated with the modal dialog.
44 NSAlert
* GetAlert() const;
46 scoped_ptr
<app_modal::JavaScriptAppModalDialog
> dialog_
;
47 scoped_ptr
<AppModalDialogHelper
> popup_helper_
;
49 // Created in the constructor and destroyed in the destructor.
50 base::scoped_nsobject
<JavaScriptAppModalDialogHelper
> helper_
;
54 DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialogCocoa
);
57 #endif // CHROME_BROWSER_UI_COCOA_JAVASCRIPT_APP_MODAL_DIALOG_COCOA_H_