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