Give the JS dialog manager the alerting frame.
https://chromium-review.googlesource.com/c/chromium/src/+/928828 https://chromium-review.googlesource.com/c/chromium/src/+/791517
This commit is contained in:
parent
eab4227cbf
commit
a1683eb4e8
2 changed files with 5 additions and 2 deletions
|
@ -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");
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue