| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_JS_MODAL_DIALOG_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_JS_MODAL_DIALOG_COCOA_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_JS_MODAL_DIALOG_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_JS_MODAL_DIALOG_COCOA_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" | 9 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/scoped_nsobject.h" | 12 #include "base/memory/scoped_nsobject.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 | 14 |
| 15 #if __OBJC__ | 15 #if __OBJC__ |
| 16 @class NSAlert; | 16 @class NSAlert; |
| 17 @class JavaScriptAppModalDialogHelper; | 17 @class JavaScriptAppModalDialogHelper; |
| 18 #else | 18 #else |
| 19 class NSAlert; | 19 class NSAlert; |
| 20 class JavaScriptAppModalDialogHelper; | 20 class JavaScriptAppModalDialogHelper; |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 class JSModalDialogCocoa : public NativeAppModalDialog { | 23 class JSModalDialogCocoa : public NativeAppModalDialog { |
| 24 public: | 24 public: |
| 25 explicit JSModalDialogCocoa(JavaScriptAppModalDialog* dialog); | 25 explicit JSModalDialogCocoa(JavaScriptAppModalDialog* dialog); |
| 26 virtual ~JSModalDialogCocoa(); | 26 virtual ~JSModalDialogCocoa(); |
| 27 | 27 |
| 28 // Overridden from NativeAppModalDialog: | 28 // Overridden from NativeAppModalDialog: |
| 29 virtual int GetAppModalDialogButtons() const; | 29 virtual int GetAppModalDialogButtons() const OVERRIDE; |
| 30 virtual void ShowAppModalDialog(); | 30 virtual void ShowAppModalDialog() OVERRIDE; |
| 31 virtual void ActivateAppModalDialog(); | 31 virtual void ActivateAppModalDialog() OVERRIDE; |
| 32 virtual void CloseAppModalDialog(); | 32 virtual void CloseAppModalDialog() OVERRIDE; |
| 33 virtual void AcceptAppModalDialog(); | 33 virtual void AcceptAppModalDialog() OVERRIDE; |
| 34 virtual void CancelAppModalDialog(); | 34 virtual void CancelAppModalDialog() OVERRIDE; |
| 35 | 35 |
| 36 JavaScriptAppModalDialog* dialog() const { return dialog_.get(); } | 36 JavaScriptAppModalDialog* dialog() const { return dialog_.get(); } |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 scoped_ptr<JavaScriptAppModalDialog> dialog_; | 39 scoped_ptr<JavaScriptAppModalDialog> dialog_; |
| 40 | 40 |
| 41 scoped_nsobject<JavaScriptAppModalDialogHelper> helper_; | 41 scoped_nsobject<JavaScriptAppModalDialogHelper> helper_; |
| 42 NSAlert* alert_; // weak, owned by |helper_|. | 42 NSAlert* alert_; // weak, owned by |helper_|. |
| 43 | 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(JSModalDialogCocoa); | 44 DISALLOW_COPY_AND_ASSIGN(JSModalDialogCocoa); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 #endif // CHROME_BROWSER_UI_COCOA_JS_MODAL_DIALOG_COCOA_H_ | 47 #endif // CHROME_BROWSER_UI_COCOA_JS_MODAL_DIALOG_COCOA_H_ |
| 48 | 48 |
| OLD | NEW |