Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: content/shell/browser/shell_javascript_dialog_manager.cc

Issue 2791873002: How to fix WebContentsImplBrowserTest.NoResetOnBeforeUnloadCanceledOnCommit. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/shell/browser/shell_javascript_dialog_manager.cc
diff --git a/content/shell/browser/shell_javascript_dialog_manager.cc b/content/shell/browser/shell_javascript_dialog_manager.cc
index b7991cb243e8f128039738017df7863eb4371a17..2ad56e7b774be5753d8f8163fcc88278d1de927b 100644
--- a/content/shell/browser/shell_javascript_dialog_manager.cc
+++ b/content/shell/browser/shell_javascript_dialog_manager.cc
@@ -15,11 +15,9 @@
namespace content {
-ShellJavaScriptDialogManager::ShellJavaScriptDialogManager()
- : should_proceed_on_beforeunload_(true) {}
+ShellJavaScriptDialogManager::ShellJavaScriptDialogManager() {}
-ShellJavaScriptDialogManager::~ShellJavaScriptDialogManager() {
-}
+ShellJavaScriptDialogManager::~ShellJavaScriptDialogManager() {}
void ShellJavaScriptDialogManager::RunJavaScriptDialog(
WebContents* web_contents,
@@ -64,14 +62,9 @@ void ShellJavaScriptDialogManager::RunBeforeUnloadDialog(
WebContents* web_contents,
bool is_reload,
const DialogClosedCallback& callback) {
- // During tests, if the BeforeUnload should not proceed automatically, store
- // the callback and return.
if (!dialog_request_callback_.is_null()) {
dialog_request_callback_.Run();
- if (should_proceed_on_beforeunload_)
- callback.Run(true, base::string16());
- else
- before_unload_callback_ = callback;
+ callback.Run(true, base::string16());
dialog_request_callback_.Reset();
return;
}
@@ -109,14 +102,6 @@ void ShellJavaScriptDialogManager::CancelDialogs(WebContents* web_contents,
#else
// TODO: implement ShellJavaScriptDialog for other platforms, drop this #if
#endif
-
- if (before_unload_callback_.is_null())
- return;
-
- if (reset_state) {
- before_unload_callback_.Run(false, base::string16());
- before_unload_callback_.Reset();
- }
}
void ShellJavaScriptDialogManager::DialogClosed(ShellJavaScriptDialog* dialog) {
« no previous file with comments | « content/shell/browser/shell_javascript_dialog_manager.h ('k') | content/test/content_browser_test_utils_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698