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

Side by Side Diff: chrome/browser/ui/javascript_dialogs/javascript_dialog.cc

Issue 2455973006: Prevent popunders with the new auto-dismissing dialogs. (Closed)
Patch Set: with test Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog.h" 5 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog.h"
6 6
7 #include "chrome/browser/ui/blocked_content/app_modal_dialog_helper.h"
7 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_views.h" 8 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_views.h"
9 #include "content/public/browser/web_contents.h"
10 #include "content/public/browser/web_contents_delegate.h"
11
12 JavaScriptDialog::JavaScriptDialog(content::WebContents* parent_web_contents) {
13 dialog_helper_.reset(new AppModalDialogHelper(parent_web_contents));
14 parent_web_contents->GetDelegate()->ActivateContents(parent_web_contents);
15 }
8 16
9 JavaScriptDialog::~JavaScriptDialog() = default; 17 JavaScriptDialog::~JavaScriptDialog() = default;
10 18
11 base::WeakPtr<JavaScriptDialog> JavaScriptDialog::Create( 19 base::WeakPtr<JavaScriptDialog> JavaScriptDialog::Create(
12 content::WebContents* parent_web_contents, 20 content::WebContents* parent_web_contents,
13 content::WebContents* alerting_web_contents, 21 content::WebContents* alerting_web_contents,
14 const base::string16& title, 22 const base::string16& title,
15 content::JavaScriptMessageType message_type, 23 content::JavaScriptMessageType message_type,
16 const base::string16& message_text, 24 const base::string16& message_text,
17 const base::string16& default_prompt_text, 25 const base::string16& default_prompt_text,
18 const content::JavaScriptDialogManager::DialogClosedCallback& 26 const content::JavaScriptDialogManager::DialogClosedCallback&
19 dialog_callback) { 27 dialog_callback) {
20 return JavaScriptDialogViews::Create( 28 return JavaScriptDialogViews::Create(
21 parent_web_contents, alerting_web_contents, title, message_type, 29 parent_web_contents, alerting_web_contents, title, message_type,
22 message_text, default_prompt_text, dialog_callback); 30 message_text, default_prompt_text, dialog_callback);
23 } 31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698