deepak1556 2018-04-12 13:18:34 +05:30 committed by Samuel Attard
parent eab4227cbf
commit a1683eb4e8
2 changed files with 5 additions and 2 deletions

View file

@ -33,12 +33,13 @@ AtomJavaScriptDialogManager::~AtomJavaScriptDialogManager() = default;
void AtomJavaScriptDialogManager::RunJavaScriptDialog(
content::WebContents* web_contents,
const GURL& origin_url,
content::RenderFrameHost* rfh,
JavaScriptDialogType dialog_type,
const base::string16& message_text,
const base::string16& default_prompt_text,
DialogClosedCallback callback,
bool* did_suppress_message) {
auto origin_url = rfh->GetLastCommittedURL();
const std::string& origin = origin_url.GetOrigin().spec();
if (origin_counts_[origin] == kUserWantsNoMoreDialogs) {
return std::move(callback).Run(false, base::string16());
@ -84,6 +85,7 @@ void AtomJavaScriptDialogManager::RunJavaScriptDialog(
void AtomJavaScriptDialogManager::RunBeforeUnloadDialog(
content::WebContents* web_contents,
content::RenderFrameHost* rfh,
bool is_reload,
DialogClosedCallback callback) {
bool default_prevented = api_web_contents_->Emit("will-prevent-unload");

View file

@ -23,13 +23,14 @@ class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager {
// content::JavaScriptDialogManager implementations.
void RunJavaScriptDialog(content::WebContents* web_contents,
const GURL& origin_url,
content::RenderFrameHost* rfh,
content::JavaScriptDialogType dialog_type,
const base::string16& message_text,
const base::string16& default_prompt_text,
DialogClosedCallback callback,
bool* did_suppress_message) override;
void RunBeforeUnloadDialog(content::WebContents* web_contents,
content::RenderFrameHost* rfh,
bool is_reload,
DialogClosedCallback callback) override;
void CancelDialogs(content::WebContents* web_contents,