| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_ | 5 #ifndef CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_ |
| 6 #define CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_ | 6 #define CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 void CancelDialogs(WebContents* web_contents, | 38 void CancelDialogs(WebContents* web_contents, |
| 39 bool reset_state) override; | 39 bool reset_state) override; |
| 40 | 40 |
| 41 // Called by the ShellJavaScriptDialog when it closes. | 41 // Called by the ShellJavaScriptDialog when it closes. |
| 42 void DialogClosed(ShellJavaScriptDialog* dialog); | 42 void DialogClosed(ShellJavaScriptDialog* dialog); |
| 43 | 43 |
| 44 // Used for content_browsertests. | 44 // Used for content_browsertests. |
| 45 void set_dialog_request_callback(const base::Closure& callback) { | 45 void set_dialog_request_callback(const base::Closure& callback) { |
| 46 dialog_request_callback_ = callback; | 46 dialog_request_callback_ = callback; |
| 47 } | 47 } |
| 48 void set_should_proceed_on_beforeunload(bool proceed) { | |
| 49 should_proceed_on_beforeunload_ = proceed; | |
| 50 } | |
| 51 | 48 |
| 52 private: | 49 private: |
| 53 #if defined(OS_MACOSX) || defined(OS_WIN) | 50 #if defined(OS_MACOSX) || defined(OS_WIN) |
| 54 // The dialog being shown. No queueing. | 51 // The dialog being shown. No queueing. |
| 55 std::unique_ptr<ShellJavaScriptDialog> dialog_; | 52 std::unique_ptr<ShellJavaScriptDialog> dialog_; |
| 56 #else | 53 #else |
| 57 // TODO: implement ShellJavaScriptDialog for other platforms, drop this #if | 54 // TODO: implement ShellJavaScriptDialog for other platforms, drop this #if |
| 58 #endif | 55 #endif |
| 59 | 56 |
| 60 base::Closure dialog_request_callback_; | 57 base::Closure dialog_request_callback_; |
| 61 | 58 |
| 62 // Whether to automatically proceed when asked to display a BeforeUnload | |
| 63 // dialog. | |
| 64 bool should_proceed_on_beforeunload_; | |
| 65 | |
| 66 DialogClosedCallback before_unload_callback_; | |
| 67 | |
| 68 DISALLOW_COPY_AND_ASSIGN(ShellJavaScriptDialogManager); | 59 DISALLOW_COPY_AND_ASSIGN(ShellJavaScriptDialogManager); |
| 69 }; | 60 }; |
| 70 | 61 |
| 71 } // namespace content | 62 } // namespace content |
| 72 | 63 |
| 73 #endif // CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_ | 64 #endif // CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_ |
| OLD | NEW |