| 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/html_dialog_gtk.h" | 5 #include "chrome/browser/ui/gtk/html_dialog_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/property_bag.h" | 9 #include "base/property_bag.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 UTF16ToUTF8(delegate_->GetDialogTitle()).c_str(), | 196 UTF16ToUTF8(delegate_->GetDialogTitle()).c_str(), |
| 197 parent_window_, | 197 parent_window_, |
| 198 flags, | 198 flags, |
| 199 NULL); | 199 NULL); |
| 200 | 200 |
| 201 SetDialogStyle(); | 201 SetDialogStyle(); |
| 202 gtk_widget_set_name(dialog_, "chrome-html-dialog"); | 202 gtk_widget_set_name(dialog_, "chrome-html-dialog"); |
| 203 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); | 203 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); |
| 204 | 204 |
| 205 tab_contents_container_.reset(new TabContentsContainerGtk(NULL)); | 205 tab_contents_container_.reset(new TabContentsContainerGtk(NULL)); |
| 206 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), | 206 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); |
| 207 gtk_box_pack_start(GTK_BOX(content_area), |
| 207 tab_contents_container_->widget(), TRUE, TRUE, 0); | 208 tab_contents_container_->widget(), TRUE, TRUE, 0); |
| 208 | 209 |
| 209 tab_contents_container_->SetTab(tab_.get()); | 210 tab_contents_container_->SetTab(tab_.get()); |
| 210 | 211 |
| 211 gfx::Size dialog_size; | 212 gfx::Size dialog_size; |
| 212 delegate_->GetDialogSize(&dialog_size); | 213 delegate_->GetDialogSize(&dialog_size); |
| 213 | 214 |
| 214 gtk_widget_set_size_request(GTK_WIDGET(tab_contents_container_->widget()), | 215 gtk_widget_set_size_request(GTK_WIDGET(tab_contents_container_->widget()), |
| 215 dialog_size.width(), | 216 dialog_size.width(), |
| 216 dialog_size.height()); | 217 dialog_size.height()); |
| 217 | 218 |
| 218 gtk_widget_show_all(dialog_); | 219 gtk_widget_show_all(dialog_); |
| 219 | 220 |
| 220 return GTK_WINDOW(dialog_); | 221 return GTK_WINDOW(dialog_); |
| 221 } | 222 } |
| 222 | 223 |
| 223 void HtmlDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { | 224 void HtmlDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { |
| 224 OnDialogClosed(std::string()); | 225 OnDialogClosed(std::string()); |
| 225 } | 226 } |
| OLD | NEW |