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

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

Issue 2412843002: Simplify the JavaScriptDialogManager. (Closed)
Patch Set: braces Created 4 years, 2 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 ee737b72835079dd252bcf43c6f295dedad8eaae..5a0dc8e1843e6b4d17e3b595b4bd93c3ae13f678 100644
--- a/content/shell/browser/shell_javascript_dialog_manager.cc
+++ b/content/shell/browser/shell_javascript_dialog_manager.cc
@@ -104,8 +104,9 @@ void ShellJavaScriptDialogManager::RunBeforeUnloadDialog(
#endif
}
-void ShellJavaScriptDialogManager::CancelActiveAndPendingDialogs(
- WebContents* web_contents) {
+void ShellJavaScriptDialogManager::CancelDialogs(WebContents* web_contents,
+ bool suppress_callbacks,
+ bool reset_state) {
#if defined(OS_MACOSX) || defined(OS_WIN)
if (dialog_) {
dialog_->Cancel();
@@ -114,13 +115,14 @@ void ShellJavaScriptDialogManager::CancelActiveAndPendingDialogs(
#else
// TODO: implement ShellJavaScriptDialog for other platforms, drop this #if
#endif
-}
-void ShellJavaScriptDialogManager::ResetDialogState(WebContents* web_contents) {
if (before_unload_callback_.is_null())
return;
- before_unload_callback_.Run(false, base::string16());
- before_unload_callback_.Reset();
+
+ if (reset_state) {
+ before_unload_callback_.Run(false, base::string16());
+ before_unload_callback_.Reset();
+ }
}
void ShellJavaScriptDialogManager::DialogClosed(ShellJavaScriptDialog* dialog) {

Powered by Google App Engine
This is Rietveld 408576698