OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/input_window_dialog.h" | 5 #include "chrome/browser/ui/input_window_dialog.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 parent, | 53 parent, |
54 GTK_DIALOG_MODAL, | 54 GTK_DIALOG_MODAL, |
55 GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, | 55 GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, |
56 GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, | 56 GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, |
57 NULL)), | 57 NULL)), |
58 delegate_(delegate) { | 58 delegate_(delegate) { |
59 gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_ACCEPT); | 59 gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_ACCEPT); |
60 gtk_dialog_set_has_separator(GTK_DIALOG(dialog_), FALSE); | 60 gtk_dialog_set_has_separator(GTK_DIALOG(dialog_), FALSE); |
61 gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); | 61 gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); |
62 | 62 |
63 GtkWidget* content_area = GTK_DIALOG(dialog_)->vbox; | 63 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); |
64 gtk_box_set_spacing(GTK_BOX(content_area), 18); | 64 gtk_box_set_spacing(GTK_BOX(content_area), 18); |
65 | 65 |
66 GtkWidget* hbox = gtk_hbox_new(FALSE, 6); | 66 GtkWidget* hbox = gtk_hbox_new(FALSE, 6); |
67 GtkWidget* label_widget = gtk_label_new(label.c_str()); | 67 GtkWidget* label_widget = gtk_label_new(label.c_str()); |
68 gtk_box_pack_start(GTK_BOX(hbox), label_widget, FALSE, FALSE, 0); | 68 gtk_box_pack_start(GTK_BOX(hbox), label_widget, FALSE, FALSE, 0); |
69 | 69 |
70 input_ = gtk_entry_new(); | 70 input_ = gtk_entry_new(); |
71 gtk_entry_set_text(GTK_ENTRY(input_), contents.c_str()); | 71 gtk_entry_set_text(GTK_ENTRY(input_), contents.c_str()); |
72 g_signal_connect(input_, "changed", | 72 g_signal_connect(input_, "changed", |
73 G_CALLBACK(OnEntryChangedThunk), this); | 73 G_CALLBACK(OnEntryChangedThunk), this); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 const string16& window_title, | 137 const string16& window_title, |
138 const string16& label, | 138 const string16& label, |
139 const string16& contents, | 139 const string16& contents, |
140 Delegate* delegate) { | 140 Delegate* delegate) { |
141 return new InputWindowDialogGtk(parent, | 141 return new InputWindowDialogGtk(parent, |
142 UTF16ToUTF8(window_title), | 142 UTF16ToUTF8(window_title), |
143 UTF16ToUTF8(label), | 143 UTF16ToUTF8(label), |
144 UTF16ToUTF8(contents), | 144 UTF16ToUTF8(contents), |
145 delegate); | 145 delegate); |
146 } | 146 } |
OLD | NEW |