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_JAVASCRIPT_APP_MODAL_DIALOG_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_JAVASCRIPT_APP_MODAL_DIALOG_COCOA_H_ |
6 #define CHROME_BROWSER_UI_COCOA_JAVASCRIPT_APP_MODAL_DIALOG_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_JAVASCRIPT_APP_MODAL_DIALOG_COCOA_H_ |
7 | 7 |
8 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" | 8 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/mac/scoped_nsobject.h" | 11 #include "base/mac/scoped_nsobject.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 | 13 |
14 #if __OBJC__ | 14 #if __OBJC__ |
15 @class NSAlert; | 15 @class NSAlert; |
16 @class JavaScriptAppModalDialogHelper; | 16 @class JavaScriptAppModalDialogHelper; |
17 #else | 17 #else |
18 class NSAlert; | 18 class NSAlert; |
19 class JavaScriptAppModalDialogHelper; | 19 class JavaScriptAppModalDialogHelper; |
20 #endif | 20 #endif |
21 | 21 |
22 class JavaScriptAppModalDialogCocoa : public NativeAppModalDialog { | 22 class JavaScriptAppModalDialogCocoa : public NativeAppModalDialog { |
23 public: | 23 public: |
24 explicit JavaScriptAppModalDialogCocoa(JavaScriptAppModalDialog* dialog); | 24 explicit JavaScriptAppModalDialogCocoa(JavaScriptAppModalDialog* dialog); |
25 virtual ~JavaScriptAppModalDialogCocoa(); | 25 virtual ~JavaScriptAppModalDialogCocoa(); |
26 | 26 |
27 // Overridden from NativeAppModalDialog: | 27 // Overridden from NativeAppModalDialog: |
28 virtual int GetAppModalDialogButtons() const OVERRIDE; | 28 virtual int GetAppModalDialogButtons() const override; |
29 virtual void ShowAppModalDialog() OVERRIDE; | 29 virtual void ShowAppModalDialog() override; |
30 virtual void ActivateAppModalDialog() OVERRIDE; | 30 virtual void ActivateAppModalDialog() override; |
31 virtual void CloseAppModalDialog() OVERRIDE; | 31 virtual void CloseAppModalDialog() override; |
32 virtual void AcceptAppModalDialog() OVERRIDE; | 32 virtual void AcceptAppModalDialog() override; |
33 virtual void CancelAppModalDialog() OVERRIDE; | 33 virtual void CancelAppModalDialog() override; |
34 | 34 |
35 JavaScriptAppModalDialog* dialog() const { return dialog_.get(); } | 35 JavaScriptAppModalDialog* dialog() const { return dialog_.get(); } |
36 | 36 |
37 private: | 37 private: |
38 // Returns the NSAlert associated with the modal dialog. | 38 // Returns the NSAlert associated with the modal dialog. |
39 NSAlert* GetAlert() const; | 39 NSAlert* GetAlert() const; |
40 | 40 |
41 scoped_ptr<JavaScriptAppModalDialog> dialog_; | 41 scoped_ptr<JavaScriptAppModalDialog> dialog_; |
42 | 42 |
43 // Created in the constructor and destroyed in the destructor. | 43 // Created in the constructor and destroyed in the destructor. |
44 base::scoped_nsobject<JavaScriptAppModalDialogHelper> helper_; | 44 base::scoped_nsobject<JavaScriptAppModalDialogHelper> helper_; |
45 | 45 |
46 DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialogCocoa); | 46 DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialogCocoa); |
47 }; | 47 }; |
48 | 48 |
49 #endif // CHROME_BROWSER_UI_COCOA_JAVASCRIPT_APP_MODAL_DIALOG_COCOA_H_ | 49 #endif // CHROME_BROWSER_UI_COCOA_JAVASCRIPT_APP_MODAL_DIALOG_COCOA_H_ |
OLD | NEW |