Clean up unneeded JavaScript dialog parameter.

Removes a parameter unneeded after https://codereview.chromium.org/2641173004.

BUG=682060
TEST=none

Review-Url: https://codereview.chromium.org/2639893002
Cr-Commit-Position: refs/heads/master@{#445273}
diff --git a/android_webview/browser/aw_javascript_dialog_manager.cc b/android_webview/browser/aw_javascript_dialog_manager.cc
index 5445bc7..7e06ff4 100644
--- a/android_webview/browser/aw_javascript_dialog_manager.cc
+++ b/android_webview/browser/aw_javascript_dialog_manager.cc
@@ -53,7 +53,6 @@
 
 void AwJavaScriptDialogManager::CancelDialogs(
     content::WebContents* web_contents,
-    bool suppress_callbacks,
     bool reset_state) {}
 
 }  // namespace android_webview
diff --git a/android_webview/browser/aw_javascript_dialog_manager.h b/android_webview/browser/aw_javascript_dialog_manager.h
index 0118578..f7790cd8 100644
--- a/android_webview/browser/aw_javascript_dialog_manager.h
+++ b/android_webview/browser/aw_javascript_dialog_manager.h
@@ -27,7 +27,6 @@
                              bool is_reload,
                              const DialogClosedCallback& callback) override;
   void CancelDialogs(content::WebContents* web_contents,
-                     bool suppress_callbacks,
                      bool reset_state) override;
 
  private:
diff --git a/chrome/browser/extensions/content_script_apitest.cc b/chrome/browser/extensions/content_script_apitest.cc
index 37d131735..6c32795 100644
--- a/chrome/browser/extensions/content_script_apitest.cc
+++ b/chrome/browser/extensions/content_script_apitest.cc
@@ -176,7 +176,7 @@
 }
 
 void DialogHelper::CloseDialogs() {
-  dialog_manager_->CancelDialogs(web_contents_, false, false);
+  dialog_manager_->CancelDialogs(web_contents_, false);
 }
 
 void DialogHelper::DialogOpened() {
diff --git a/chrome/browser/ui/javascript_dialogs/javascript_dialog_browsertest.cc b/chrome/browser/ui/javascript_dialogs/javascript_dialog_browsertest.cc
index d3f328f..98c6a25d 100644
--- a/chrome/browser/ui/javascript_dialogs/javascript_dialog_browsertest.cc
+++ b/chrome/browser/ui/javascript_dialogs/javascript_dialog_browsertest.cc
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "base/logging.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/scoped_command_line.h"
 #include "base/test/scoped_feature_list.h"
diff --git a/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc b/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc
index 625c37e..37de8e8 100644
--- a/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc
+++ b/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc
@@ -242,15 +242,13 @@
 
 void JavaScriptDialogTabHelper::CancelDialogs(
     content::WebContents* web_contents,
-    bool suppress_callbacks,
     bool reset_state) {
   if (dialog_) {
     CloseDialog(false, base::string16(), DismissalCause::CANCEL_DIALOGS_CALLED);
   }
 
   // Cancel any app-modal dialogs being run by the app-modal dialog system.
-  return AppModalDialogManager()->CancelDialogs(
-      web_contents, suppress_callbacks, reset_state);
+  return AppModalDialogManager()->CancelDialogs(web_contents, reset_state);
 }
 
 void JavaScriptDialogTabHelper::WasHidden() {
diff --git a/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.h b/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.h
index 6c4cae76..35cc6d8 100644
--- a/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.h
+++ b/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.h
@@ -53,7 +53,6 @@
                               bool accept,
                               const base::string16* prompt_override) override;
   void CancelDialogs(content::WebContents* web_contents,
-                     bool suppress_callbacks,
                      bool reset_state) override;
 
   // WebContentsObserver:
diff --git a/components/app_modal/app_modal_dialog.cc b/components/app_modal/app_modal_dialog.cc
index 4e9ac92..8689b7f 100644
--- a/components/app_modal/app_modal_dialog.cc
+++ b/components/app_modal/app_modal_dialog.cc
@@ -52,7 +52,7 @@
   return valid_;
 }
 
-void AppModalDialog::Invalidate(bool suppress_callbacks) {
+void AppModalDialog::Invalidate() {
   valid_ = false;
 }
 
diff --git a/components/app_modal/app_modal_dialog.h b/components/app_modal/app_modal_dialog.h
index 78b4b7e..c4923ea 100644
--- a/components/app_modal/app_modal_dialog.h
+++ b/components/app_modal/app_modal_dialog.h
@@ -55,7 +55,7 @@
 
   // Invalidates the dialog, therefore causing it to not be shown when its turn
   // to be shown comes around.
-  virtual void Invalidate(bool suppress_callbacks);
+  virtual void Invalidate();
 
   // Used only for testing. Returns whether the dialog is a JavaScript modal
   // dialog.
diff --git a/components/app_modal/javascript_app_modal_dialog.cc b/components/app_modal/javascript_app_modal_dialog.cc
index 992f646..7a48f2a3 100644
--- a/components/app_modal/javascript_app_modal_dialog.cc
+++ b/components/app_modal/javascript_app_modal_dialog.cc
@@ -92,13 +92,12 @@
   return true;
 }
 
-void JavaScriptAppModalDialog::Invalidate(bool suppress_callbacks) {
+void JavaScriptAppModalDialog::Invalidate() {
   if (!IsValid())
     return;
 
-  AppModalDialog::Invalidate(suppress_callbacks);
-  if (!suppress_callbacks)
-    CallDialogClosedCallback(false, base::string16());
+  AppModalDialog::Invalidate();
+  CallDialogClosedCallback(false, base::string16());
   if (native_dialog())
     CloseModalDialog();
 }
@@ -155,7 +154,7 @@
 
   // On Views, we can end up coming through this code path twice :(.
   // See crbug.com/63732.
-  AppModalDialog::Invalidate(false);
+  AppModalDialog::Invalidate();
 }
 
 void JavaScriptAppModalDialog::CallDialogClosedCallback(bool success,
diff --git a/components/app_modal/javascript_app_modal_dialog.h b/components/app_modal/javascript_app_modal_dialog.h
index 4bcab18..0fb4d89978 100644
--- a/components/app_modal/javascript_app_modal_dialog.h
+++ b/components/app_modal/javascript_app_modal_dialog.h
@@ -52,7 +52,7 @@
   // Overridden from AppModalDialog:
   NativeAppModalDialog* CreateNativeDialog() override;
   bool IsJavaScriptModalDialog() override;
-  void Invalidate(bool suppress_callbacks) override;
+  void Invalidate() override;
 
   // Callbacks from NativeDialog when the user accepts or cancels the dialog.
   void OnCancel(bool suppress_js_messages);
diff --git a/components/app_modal/javascript_dialog_manager.cc b/components/app_modal/javascript_dialog_manager.cc
index 561555a..54f3afb4 100644
--- a/components/app_modal/javascript_dialog_manager.cc
+++ b/components/app_modal/javascript_dialog_manager.cc
@@ -268,7 +268,6 @@
 }
 
 void JavaScriptDialogManager::CancelDialogs(content::WebContents* web_contents,
-                                            bool suppress_callbacks,
                                             bool reset_state) {
   AppModalDialogQueue* queue = AppModalDialogQueue::GetInstance();
   AppModalDialog* active_dialog = queue->active_dialog();
@@ -279,10 +278,10 @@
     if ((*i) == active_dialog)
       continue;
     if ((*i)->web_contents() == web_contents)
-      (*i)->Invalidate(suppress_callbacks);
+      (*i)->Invalidate();
   }
   if (active_dialog && active_dialog->web_contents() == web_contents)
-    active_dialog->Invalidate(suppress_callbacks);
+    active_dialog->Invalidate();
 
   if (reset_state)
     javascript_dialog_extra_data_.erase(web_contents);
diff --git a/components/app_modal/javascript_dialog_manager.h b/components/app_modal/javascript_dialog_manager.h
index 3018142..b5f0a97 100644
--- a/components/app_modal/javascript_dialog_manager.h
+++ b/components/app_modal/javascript_dialog_manager.h
@@ -56,7 +56,6 @@
                               bool accept,
                               const base::string16* prompt_override) override;
   void CancelDialogs(content::WebContents* web_contents,
-                     bool suppress_callbacks,
                      bool reset_state) override;
 
  private:
diff --git a/content/browser/devtools/protocol/devtools_protocol_browsertest.cc b/content/browser/devtools/protocol/devtools_protocol_browsertest.cc
index c19559b..b7a73c0 100644
--- a/content/browser/devtools/protocol/devtools_protocol_browsertest.cc
+++ b/content/browser/devtools/protocol/devtools_protocol_browsertest.cc
@@ -119,7 +119,6 @@
   }
 
   void CancelDialogs(WebContents* web_contents,
-                     bool suppress_callbacks,
                      bool reset_state) override {}
 
  private:
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 6bf87642..95a4592 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -514,10 +514,7 @@
 
   // Clear out any JavaScript state.
   if (dialog_manager_) {
-    // This object is being destructed, so make sure that no callbacks happen.
-    dialog_manager_->CancelDialogs(this,
-                                   true,   // suppress_callbacks,
-                                   true);  // reset_state
+    dialog_manager_->CancelDialogs(this, /*reset_state=*/true);
   }
 
   if (color_chooser_info_.get())
@@ -898,9 +895,7 @@
 
 void WebContentsImpl::CancelActiveAndPendingDialogs() {
   if (dialog_manager_) {
-    dialog_manager_->CancelDialogs(this,
-                                   false,   // suppress_callbacks,
-                                   false);  // reset_state
+    dialog_manager_->CancelDialogs(this, /*reset_state=*/false);
   }
   if (browser_plugin_embedder_)
     browser_plugin_embedder_->CancelGuestDialogs();
@@ -3471,9 +3466,7 @@
   // If this is a user-initiated navigation, start allowing JavaScript dialogs
   // again.
   if (params.gesture == NavigationGestureUser && dialog_manager_) {
-    dialog_manager_->CancelDialogs(this,
-                                   false,  // suppress_callbacks,
-                                   true);  // reset_state
+    dialog_manager_->CancelDialogs(this, /*reset_state=*/true);
   }
 
   // Notify observers about navigation.
@@ -4950,9 +4943,7 @@
   // cross-process navigation will either destroy the browser plugins or not
   // require their dialogs to close.
   if (dialog_manager_) {
-    dialog_manager_->CancelDialogs(this,
-                                   false,  // suppress_callbacks,
-                                   true);  // reset_state
+    dialog_manager_->CancelDialogs(this, /*reset_state=*/true);
   }
 }
 
diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc
index 6a6dae67..55f38c8 100644
--- a/content/browser/web_contents/web_contents_impl_browsertest.cc
+++ b/content/browser/web_contents/web_contents_impl_browsertest.cc
@@ -980,7 +980,6 @@
   }
 
   void CancelDialogs(WebContents* web_contents,
-                     bool suppress_callbacks,
                      bool reset_state) override {}
 
  private:
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc
index 8ba2b052..ebe84c7 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -3413,7 +3413,6 @@
   }
 
   void CancelDialogs(WebContents* web_contents,
-                     bool suppress_callbacks,
                      bool reset_state) override {
     if (reset_state)
       ++reset_count_;
diff --git a/content/public/browser/javascript_dialog_manager.h b/content/public/browser/javascript_dialog_manager.h
index fb1fbd1..3598fee 100644
--- a/content/public/browser/javascript_dialog_manager.h
+++ b/content/public/browser/javascript_dialog_manager.h
@@ -51,11 +51,8 @@
                                       const base::string16* prompt_override);
 
   // Cancels all active and pending dialogs for the given WebContents. If
-  // |suppress_callbacks| is true, suppresses the calls to callbacks while
-  // canceling those dialogs. If |reset_state| is true, resets any saved state
-  // tied to |web_contents|.
+  // |reset_state| is true, resets any saved state tied to |web_contents|.
   virtual void CancelDialogs(WebContents* web_contents,
-                             bool suppress_callbacks,
                              bool reset_state) = 0;
 
   virtual ~JavaScriptDialogManager() {}
diff --git a/content/shell/browser/shell_javascript_dialog_manager.cc b/content/shell/browser/shell_javascript_dialog_manager.cc
index 5a0dc8e..f720f80 100644
--- a/content/shell/browser/shell_javascript_dialog_manager.cc
+++ b/content/shell/browser/shell_javascript_dialog_manager.cc
@@ -105,7 +105,6 @@
 }
 
 void ShellJavaScriptDialogManager::CancelDialogs(WebContents* web_contents,
-                                                 bool suppress_callbacks,
                                                  bool reset_state) {
 #if defined(OS_MACOSX) || defined(OS_WIN)
   if (dialog_) {
diff --git a/content/shell/browser/shell_javascript_dialog_manager.h b/content/shell/browser/shell_javascript_dialog_manager.h
index d35f370..54482bf 100644
--- a/content/shell/browser/shell_javascript_dialog_manager.h
+++ b/content/shell/browser/shell_javascript_dialog_manager.h
@@ -36,7 +36,6 @@
                              const DialogClosedCallback& callback) override;
 
   void CancelDialogs(WebContents* web_contents,
-                     bool suppress_callbacks,
                      bool reset_state) override;
 
   // Called by the ShellJavaScriptDialog when it closes.
diff --git a/extensions/browser/guest_view/web_view/javascript_dialog_helper.cc b/extensions/browser/guest_view/web_view/javascript_dialog_helper.cc
index 9a9763d..200559c 100644
--- a/extensions/browser/guest_view/web_view/javascript_dialog_helper.cc
+++ b/extensions/browser/guest_view/web_view/javascript_dialog_helper.cc
@@ -86,7 +86,6 @@
 }
 
 void JavaScriptDialogHelper::CancelDialogs(content::WebContents* web_contents,
-                                           bool suppress_callbacks,
                                            bool reset_state) {}
 
 void JavaScriptDialogHelper::OnPermissionResponse(
diff --git a/extensions/browser/guest_view/web_view/javascript_dialog_helper.h b/extensions/browser/guest_view/web_view/javascript_dialog_helper.h
index 851c729..87e63cb 100644
--- a/extensions/browser/guest_view/web_view/javascript_dialog_helper.h
+++ b/extensions/browser/guest_view/web_view/javascript_dialog_helper.h
@@ -33,7 +33,6 @@
                               bool accept,
                               const base::string16* prompt_override) override;
   void CancelDialogs(content::WebContents* web_contents,
-                     bool suppress_callbacks,
                      bool reset_state) override;
 
  private: