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/gtk/external_protocol_dialog_gtk.h" | 5 #include "chrome/browser/ui/gtk/external_protocol_dialog_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 gtk_util::SetLabelWidth(label, kMessageWidth); | 89 gtk_util::SetLabelWidth(label, kMessageWidth); |
90 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0); | 90 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0); |
91 | 91 |
92 // Add the checkbox. | 92 // Add the checkbox. |
93 checkbox_ = gtk_check_button_new_with_label( | 93 checkbox_ = gtk_check_button_new_with_label( |
94 l10n_util::GetStringUTF8(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT).c_str()); | 94 l10n_util::GetStringUTF8(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT).c_str()); |
95 gtk_box_pack_start(GTK_BOX(vbox), checkbox_, | 95 gtk_box_pack_start(GTK_BOX(vbox), checkbox_, |
96 FALSE, FALSE, 0); | 96 FALSE, FALSE, 0); |
97 | 97 |
98 // Add our vbox to the dialog. | 98 // Add our vbox to the dialog. |
99 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), vbox, | 99 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); |
100 FALSE, FALSE, 0); | 100 gtk_box_pack_start(GTK_BOX(content_area), vbox, FALSE, FALSE, 0); |
101 | 101 |
102 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); | 102 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); |
103 | 103 |
104 gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); | 104 gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); |
105 gtk_widget_show_all(dialog_); | 105 gtk_widget_show_all(dialog_); |
106 } | 106 } |
107 | 107 |
108 ExternalProtocolDialogGtk::~ExternalProtocolDialogGtk() { | 108 ExternalProtocolDialogGtk::~ExternalProtocolDialogGtk() { |
109 } | 109 } |
110 | 110 |
(...skipping 13 matching lines...) Expand all Loading... |
124 if (response_id == GTK_RESPONSE_ACCEPT) { | 124 if (response_id == GTK_RESPONSE_ACCEPT) { |
125 UMA_HISTOGRAM_LONG_TIMES("clickjacking.launch_url", | 125 UMA_HISTOGRAM_LONG_TIMES("clickjacking.launch_url", |
126 base::TimeTicks::Now() - creation_time_); | 126 base::TimeTicks::Now() - creation_time_); |
127 | 127 |
128 ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(url_); | 128 ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(url_); |
129 } | 129 } |
130 | 130 |
131 gtk_widget_destroy(dialog_); | 131 gtk_widget_destroy(dialog_); |
132 delete this; | 132 delete this; |
133 } | 133 } |
OLD | NEW |