| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <gtk/gtk.h> | 5 #include <gtk/gtk.h> |
| 6 | 6 |
| 7 #include "app/gfx/gtk_util.h" | 7 #include "app/gfx/gtk_util.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/browser/gtk/options/url_picker_dialog_gtk.h" | 10 #include "chrome/browser/gtk/options/url_picker_dialog_gtk.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // Loading data, showing dialog. | 145 // Loading data, showing dialog. |
| 146 url_table_model_.reset(new PossibleURLModel()); | 146 url_table_model_.reset(new PossibleURLModel()); |
| 147 url_table_adapter_.reset(new gtk_tree::TableAdapter(this, history_list_store_, | 147 url_table_adapter_.reset(new gtk_tree::TableAdapter(this, history_list_store_, |
| 148 url_table_model_.get())); | 148 url_table_model_.get())); |
| 149 url_table_model_->Reload(profile_); | 149 url_table_model_->Reload(profile_); |
| 150 | 150 |
| 151 EnableControls(); | 151 EnableControls(); |
| 152 | 152 |
| 153 // Set the size of the dialog. | 153 // Set the size of the dialog. |
| 154 gtk_widget_realize(dialog_); | 154 gtk_widget_realize(dialog_); |
| 155 int width = 1, height = 1; | 155 gtk_util::SetWindowSizeFromResources(GTK_WINDOW(dialog_), |
| 156 gtk_util::GetWidgetSizeFromResources( | 156 IDS_URLPICKER_DIALOG_WIDTH_CHARS, |
| 157 dialog_, | 157 IDS_URLPICKER_DIALOG_HEIGHT_LINES, |
| 158 IDS_URLPICKER_DIALOG_WIDTH_CHARS, | 158 true); |
| 159 IDS_URLPICKER_DIALOG_HEIGHT_LINES, | 159 |
| 160 &width, &height); | |
| 161 gtk_window_set_default_size(GTK_WINDOW(dialog_), width, height); | |
| 162 // Set the width of the first column as well. | 160 // Set the width of the first column as well. |
| 161 int width; |
| 163 gtk_util::GetWidgetSizeFromResources( | 162 gtk_util::GetWidgetSizeFromResources( |
| 164 dialog_, | 163 dialog_, |
| 165 IDS_URLPICKER_DIALOG_LEFT_COLUMN_WIDTH_CHARS, 0, | 164 IDS_URLPICKER_DIALOG_LEFT_COLUMN_WIDTH_CHARS, 0, |
| 166 &width, NULL); | 165 &width, NULL); |
| 167 gtk_tree_view_column_set_fixed_width(column, width); | 166 gtk_tree_view_column_set_fixed_width(column, width); |
| 168 | 167 |
| 169 gtk_widget_show_all(dialog_); | 168 gtk_widget_show_all(dialog_); |
| 170 | 169 |
| 171 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponse), this); | 170 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponse), this); |
| 172 g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroy), this); | 171 g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroy), this); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 window->AddURL(); | 273 window->AddURL(); |
| 275 } | 274 } |
| 276 gtk_widget_destroy(window->dialog_); | 275 gtk_widget_destroy(window->dialog_); |
| 277 } | 276 } |
| 278 | 277 |
| 279 // static | 278 // static |
| 280 void UrlPickerDialogGtk::OnWindowDestroy(GtkWidget* widget, | 279 void UrlPickerDialogGtk::OnWindowDestroy(GtkWidget* widget, |
| 281 UrlPickerDialogGtk* window) { | 280 UrlPickerDialogGtk* window) { |
| 282 MessageLoop::current()->DeleteSoon(FROM_HERE, window); | 281 MessageLoop::current()->DeleteSoon(FROM_HERE, window); |
| 283 } | 282 } |
| OLD | NEW |