diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-26 00:05:54 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-26 00:05:54 +0000 |
commit | 9045ff8b748950d11f5c750cbf59e56606e80ec5 (patch) | |
tree | 5679ab0c44f3e7e5f94e7139afa81e16d529894d /chrome/browser/app_modal_dialog_gtk.cc | |
parent | 0dfd3119fe5e7d357818cd869a196dfe50f6876c (diff) | |
download | chromium_src-9045ff8b748950d11f5c750cbf59e56606e80ec5.zip chromium_src-9045ff8b748950d11f5c750cbf59e56606e80ec5.tar.gz chromium_src-9045ff8b748950d11f5c750cbf59e56606e80ec5.tar.bz2 |
Linux: implement automation for modal dialogs.
The Linux ui_tests are currently red because
BrowserCloseBeforeUnloadOK and BrowserCloseBeforeUnloadCancel are
failing. This is because we didn't implement several automation
functions regarding modal dialogs and someone obviously wrote a test
which needed them.
So this is a TBR in order to green the tree.
TBR=tony
http://codereview.chromium.org/99032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14549 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_modal_dialog_gtk.cc')
-rw-r--r-- | chrome/browser/app_modal_dialog_gtk.cc | 21 |
1 files changed, 17 insertions, 4 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); } |