From 4c8e483bc12dff5e14e7cde648773e4f415c17cd Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 1 Mar 2014 19:53:50 +0800 Subject: [PATCH] Make the default alert() do nothing. --- browser/atom_javascript_dialog_manager.cc | 12 ++++++++++++ browser/atom_javascript_dialog_manager.h | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/browser/atom_javascript_dialog_manager.cc b/browser/atom_javascript_dialog_manager.cc index 52cd59fd2b71..33f1314235f0 100644 --- a/browser/atom_javascript_dialog_manager.cc +++ b/browser/atom_javascript_dialog_manager.cc @@ -8,6 +8,18 @@ namespace atom { +void AtomJavaScriptDialogManager::RunJavaScriptDialog( + content::WebContents* web_contents, + const GURL& origin_url, + const std::string& accept_lang, + content::JavaScriptMessageType javascript_message_type, + const string16& message_text, + const string16& default_prompt_text, + const DialogClosedCallback& callback, + bool* did_suppress_message) { + callback.Run(false, string16()); +} + void AtomJavaScriptDialogManager::RunBeforeUnloadDialog( content::WebContents* web_contents, const string16& message_text, diff --git a/browser/atom_javascript_dialog_manager.h b/browser/atom_javascript_dialog_manager.h index 38ed75b317d9..65f4e9f927a9 100644 --- a/browser/atom_javascript_dialog_manager.h +++ b/browser/atom_javascript_dialog_manager.h @@ -20,7 +20,7 @@ class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager { const string16& message_text, const string16& default_prompt_text, const DialogClosedCallback& callback, - bool* did_suppress_message) OVERRIDE {} + bool* did_suppress_message) OVERRIDE; virtual void RunBeforeUnloadDialog( content::WebContents* web_contents, const string16& message_text,