summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/app_modal_dialog_gtk.cc21
-rw-r--r--chrome/browser/unload_uitest.cc2
2 files changed, 18 insertions, 5 deletions
diff --git a/chrome/browser/app_modal_dialog_gtk.cc b/chrome/browser/app_modal_dialog_gtk.cc
index b44d865..2f9337d 100644
--- a/chrome/browser/app_modal_dialog_gtk.cc
+++ b/chrome/browser/app_modal_dialog_gtk.cc
@@ -107,14 +107,27 @@ void AppModalDialog::CloseModalDialog() {
}
int AppModalDialog::GetDialogButtons() {
- NOTIMPLEMENTED();
- return 0;
+ switch (dialog_flags_) {
+ case MessageBoxFlags::kIsJavascriptAlert:
+ return MessageBoxFlags::DIALOGBUTTON_OK;
+
+ case MessageBoxFlags::kIsJavascriptConfirm:
+ return MessageBoxFlags::DIALOGBUTTON_OK |
+ MessageBoxFlags::DIALOGBUTTON_CANCEL;
+
+ case MessageBoxFlags::kIsJavascriptPrompt:
+ return MessageBoxFlags::DIALOGBUTTON_OK;
+
+ default:
+ NOTREACHED();
+ return 0;
+ }
}
void AppModalDialog::AcceptWindow() {
- NOTIMPLEMENTED();
+ OnDialogResponse(GTK_DIALOG(dialog_), GTK_RESPONSE_OK, this);
}
void AppModalDialog::CancelWindow() {
- NOTIMPLEMENTED();
+ OnDialogResponse(GTK_DIALOG(dialog_), GTK_RESPONSE_CANCEL, this);
}
diff --git a/chrome/browser/unload_uitest.cc b/chrome/browser/unload_uitest.cc
index 71f1fd1..316857b 100644
--- a/chrome/browser/unload_uitest.cc
+++ b/chrome/browser/unload_uitest.cc
@@ -155,7 +155,7 @@ class UnloadTest : public UITest {
}
void ClickModalDialogButton(MessageBoxFlags::DialogButton button) {
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(OS_LINUX)
bool modal_dialog_showing = false;
MessageBoxFlags::DialogButton available_buttons;
EXPECT_TRUE(automation()->WaitForAppModalDialog(3000));