OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk/html_dialog_gtk.h" | 5 #include "chrome/browser/gtk/html_dialog_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
10 #include "chrome/browser/browser_window.h" | 10 #include "chrome/browser/browser_window.h" |
11 #include "chrome/browser/dom_ui/html_dialog_ui.h" | 11 #include "chrome/browser/dom_ui/html_dialog_ui.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 GtkDialogFlags flags = GTK_DIALOG_NO_SEPARATOR; | 135 GtkDialogFlags flags = GTK_DIALOG_NO_SEPARATOR; |
136 if (delegate_->IsDialogModal()) | 136 if (delegate_->IsDialogModal()) |
137 flags = static_cast<GtkDialogFlags>(flags | GTK_DIALOG_MODAL); | 137 flags = static_cast<GtkDialogFlags>(flags | GTK_DIALOG_MODAL); |
138 | 138 |
139 dialog_ = gtk_dialog_new_with_buttons( | 139 dialog_ = gtk_dialog_new_with_buttons( |
140 WideToUTF8(delegate_->GetDialogTitle()).c_str(), | 140 WideToUTF8(delegate_->GetDialogTitle()).c_str(), |
141 parent_window_, | 141 parent_window_, |
142 flags, | 142 flags, |
143 NULL); | 143 NULL); |
144 | 144 |
145 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponse), this); | 145 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); |
146 | 146 |
147 tab_contents_container_.reset(new TabContentsContainerGtk(NULL)); | 147 tab_contents_container_.reset(new TabContentsContainerGtk(NULL)); |
148 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), | 148 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), |
149 tab_contents_container_->widget(), TRUE, TRUE, 0); | 149 tab_contents_container_->widget(), TRUE, TRUE, 0); |
150 | 150 |
151 tab_contents_container_->SetTabContents(tab_contents_.get()); | 151 tab_contents_container_->SetTabContents(tab_contents_.get()); |
152 | 152 |
153 gfx::Size dialog_size; | 153 gfx::Size dialog_size; |
154 delegate_->GetDialogSize(&dialog_size); | 154 delegate_->GetDialogSize(&dialog_size); |
155 | 155 |
156 gtk_widget_set_size_request(GTK_WIDGET(tab_contents_container_->widget()), | 156 gtk_widget_set_size_request(GTK_WIDGET(tab_contents_container_->widget()), |
157 dialog_size.width(), | 157 dialog_size.width(), |
158 dialog_size.height()); | 158 dialog_size.height()); |
159 | 159 |
160 gtk_widget_show_all(dialog_); | 160 gtk_widget_show_all(dialog_); |
161 } | 161 } |
162 | 162 |
163 // static | 163 void HtmlDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { |
164 void HtmlDialogGtk::OnResponse(GtkWidget* widget, int response, | 164 OnDialogClosed(std::string()); |
165 HtmlDialogGtk* dialog) { | |
166 dialog->OnDialogClosed(std::string()); | |
167 } | 165 } |
OLD | NEW |