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

Unified Diff: components/app_modal/javascript_dialog_manager.cc

Issue 2754143003: For a "cancel" of an alert dialog via HandleJavaScriptDialog, click the only button, "OK". (Closed)
Patch Set: fully qualify Created 3 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/app_modal/javascript_dialog_manager.cc
diff --git a/components/app_modal/javascript_dialog_manager.cc b/components/app_modal/javascript_dialog_manager.cc
index cec07c96d5fe325eeac4778f2b8d85f5eb95bbbc..c5a368384b597f56c031f3c1ad1c6b89f659e268 100644
--- a/components/app_modal/javascript_dialog_manager.cc
+++ b/components/app_modal/javascript_dialog_manager.cc
@@ -248,8 +248,17 @@ bool JavaScriptDialogManager::HandleJavaScriptDialog(
dialog_queue->active_dialog()->web_contents() != web_contents) {
return false;
}
+
JavaScriptAppModalDialog* dialog = static_cast<JavaScriptAppModalDialog*>(
dialog_queue->active_dialog());
+
+ if (dialog->javascript_dialog_type() ==
+ content::JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_ALERT) {
+ // Alert dialogs only have one button: OK. Any "handling" of this dialog has
+ // to be a click on the OK button.
+ accept = true;
+ }
+
if (accept) {
if (prompt_override)
dialog->SetOverridePromptText(*prompt_override);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698