summaryrefslogtreecommitdiffstats
path: root/chrome/browser/app_modal_dialog_gtk.cc
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-29 01:06:01 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-29 01:06:01 +0000
commitb5295a1285c31d9a4b20f02694e07b7334316afc (patch)
tree6c4267383b1ef16754d548af8501debb5f2716ae /chrome/browser/app_modal_dialog_gtk.cc
parent9db40b680c36437f5e9aa30d0d7aa88f3d24dea6 (diff)
downloadchromium_src-b5295a1285c31d9a4b20f02694e07b7334316afc.zip
chromium_src-b5295a1285c31d9a4b20f02694e07b7334316afc.tar.gz
chromium_src-b5295a1285c31d9a4b20f02694e07b7334316afc.tar.bz2
Pressing "enter" while the JS prompt text entry has focus should
accept the user's text. Review URL: http://codereview.chromium.org/114058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17157 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_modal_dialog_gtk.cc')
-rw-r--r--chrome/browser/app_modal_dialog_gtk.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/browser/app_modal_dialog_gtk.cc b/chrome/browser/app_modal_dialog_gtk.cc
index 72603a2..40b04ed 100644
--- a/chrome/browser/app_modal_dialog_gtk.cc
+++ b/chrome/browser/app_modal_dialog_gtk.cc
@@ -104,7 +104,8 @@ void AppModalDialog::CreateAndShowDialog() {
message_type, buttons, "%s", WideToUTF8(message_text_).c_str());
gtk_window_set_title(GTK_WINDOW(dialog_), WideToUTF8(title_).c_str());
- // Adjust content area as needed.
+ // Adjust content area as needed. Set up the prompt text entry or
+ // suppression check box.
if (MessageBoxFlags::kIsJavascriptPrompt == dialog_flags_) {
// TODO(tc): Replace with gtk_dialog_get_content_area() when using GTK 2.14+
GtkWidget* contents_vbox = GTK_DIALOG(dialog_)->vbox;
@@ -113,6 +114,7 @@ void AppModalDialog::CreateAndShowDialog() {
WideToUTF8(default_prompt_text_).c_str());
gtk_box_pack_start(GTK_BOX(contents_vbox), text_box, TRUE, TRUE, 0);
g_object_set_data(G_OBJECT(dialog_), kPromptTextId, text_box);
+ gtk_entry_set_activates_default(GTK_ENTRY(text_box), TRUE);
}
if (display_suppress_checkbox_) {