| 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 <memory> |
| 9 |
| 8 #include "base/logging.h" | 10 #include "base/logging.h" |
| 9 #include "base/mac/scoped_nsobject.h" | 11 #include "base/mac/scoped_nsobject.h" |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "components/app_modal/native_app_modal_dialog.h" | 13 #include "components/app_modal/native_app_modal_dialog.h" |
| 13 | 14 |
| 14 class AppModalDialogHelper; | 15 class AppModalDialogHelper; |
| 15 | 16 |
| 16 #if __OBJC__ | 17 #if __OBJC__ |
| 17 @class NSAlert; | 18 @class NSAlert; |
| 18 @class JavaScriptAppModalDialogHelper; | 19 @class JavaScriptAppModalDialogHelper; |
| 19 #else | 20 #else |
| 20 class NSAlert; | 21 class NSAlert; |
| 21 class JavaScriptAppModalDialogHelper; | 22 class JavaScriptAppModalDialogHelper; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 37 bool IsShowing() const override; | 38 bool IsShowing() const override; |
| 38 | 39 |
| 39 app_modal::JavaScriptAppModalDialog* dialog() const { | 40 app_modal::JavaScriptAppModalDialog* dialog() const { |
| 40 return dialog_.get(); | 41 return dialog_.get(); |
| 41 } | 42 } |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 // Returns the NSAlert associated with the modal dialog. | 45 // Returns the NSAlert associated with the modal dialog. |
| 45 NSAlert* GetAlert() const; | 46 NSAlert* GetAlert() const; |
| 46 | 47 |
| 47 scoped_ptr<app_modal::JavaScriptAppModalDialog> dialog_; | 48 std::unique_ptr<app_modal::JavaScriptAppModalDialog> dialog_; |
| 48 scoped_ptr<AppModalDialogHelper> popup_helper_; | 49 std::unique_ptr<AppModalDialogHelper> popup_helper_; |
| 49 | 50 |
| 50 // Created in the constructor and destroyed in the destructor. | 51 // Created in the constructor and destroyed in the destructor. |
| 51 base::scoped_nsobject<JavaScriptAppModalDialogHelper> helper_; | 52 base::scoped_nsobject<JavaScriptAppModalDialogHelper> helper_; |
| 52 | 53 |
| 53 bool is_showing_; | 54 bool is_showing_; |
| 54 | 55 |
| 55 DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialogCocoa); | 56 DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialogCocoa); |
| 56 }; | 57 }; |
| 57 | 58 |
| 58 #endif // CHROME_BROWSER_UI_COCOA_JAVASCRIPT_APP_MODAL_DIALOG_COCOA_H_ | 59 #endif // CHROME_BROWSER_UI_COCOA_JAVASCRIPT_APP_MODAL_DIALOG_COCOA_H_ |
| OLD | NEW |