Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / javascript_app_modal_dialog_cocoa.h
blobaa7153c0e15e46a0a27399820ca82c9bd347a8e2
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"
14 #if __OBJC__
15 @class NSAlert;
16 @class JavaScriptAppModalDialogHelper;
17 #else
18 class NSAlert;
19 class JavaScriptAppModalDialogHelper;
20 #endif
22 class JavaScriptAppModalDialogCocoa : public NativeAppModalDialog {
23 public:
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(); }
37 private:
38 scoped_ptr<JavaScriptAppModalDialog> dialog_;
40 base::scoped_nsobject<JavaScriptAppModalDialogHelper> helper_;
41 NSAlert* alert_; // weak, owned by |helper_|.
43 DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialogCocoa);
46 #endif // CHROME_BROWSER_UI_COCOA_JAVASCRIPT_APP_MODAL_DIALOG_COCOA_H_