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 "chrome/browser/gtk/clear_browsing_data_dialog_gtk.h" | 5 #include "chrome/browser/gtk/clear_browsing_data_dialog_gtk.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "chrome/browser/browsing_data_remover.h" | 9 #include "chrome/browser/browsing_data_remover.h" |
10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 profile_(profile), remover_(NULL) { | 24 profile_(profile), remover_(NULL) { |
25 // Build the dialog. | 25 // Build the dialog. |
26 GtkWidget* dialog = gtk_dialog_new_with_buttons( | 26 GtkWidget* dialog = gtk_dialog_new_with_buttons( |
27 l10n_util::GetStringUTF8(IDS_CLEAR_BROWSING_DATA_TITLE).c_str(), | 27 l10n_util::GetStringUTF8(IDS_CLEAR_BROWSING_DATA_TITLE).c_str(), |
28 parent, | 28 parent, |
29 (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR), | 29 (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR), |
30 GTK_STOCK_CLOSE, | 30 GTK_STOCK_CLOSE, |
31 GTK_RESPONSE_REJECT, | 31 GTK_RESPONSE_REJECT, |
32 NULL); | 32 NULL); |
33 gtk_widget_realize(dialog); | 33 gtk_widget_realize(dialog); |
34 gtk_util::SetWindowWidthFromResources(GTK_WINDOW(dialog), | 34 gtk_util::SetWindowSizeFromResources(GTK_WINDOW(dialog), |
35 IDS_CLEARDATA_DIALOG_WIDTH_CHARS, | 35 IDS_CLEARDATA_DIALOG_WIDTH_CHARS, |
36 /* resizable */ false); | 36 -1, // height |
| 37 false); // resizable |
37 gtk_util::AddButtonToDialog(dialog, | 38 gtk_util::AddButtonToDialog(dialog, |
38 l10n_util::GetStringUTF8(IDS_CLEAR_BROWSING_DATA_COMMIT).c_str(), | 39 l10n_util::GetStringUTF8(IDS_CLEAR_BROWSING_DATA_COMMIT).c_str(), |
39 GTK_STOCK_APPLY, GTK_RESPONSE_ACCEPT); | 40 GTK_STOCK_APPLY, GTK_RESPONSE_ACCEPT); |
40 | 41 |
41 GtkWidget* content_area = GTK_DIALOG(dialog)->vbox; | 42 GtkWidget* content_area = GTK_DIALOG(dialog)->vbox; |
42 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); | 43 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); |
43 | 44 |
44 GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); | 45 GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); |
45 gtk_container_add(GTK_CONTAINER(content_area), vbox); | 46 gtk_container_add(GTK_CONTAINER(content_area), vbox); |
46 | 47 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 true : false); | 214 true : false); |
214 } else if (widget == del_form_data_checkbox_) { | 215 } else if (widget == del_form_data_checkbox_) { |
215 profile_->GetPrefs()->SetBoolean(prefs::kDeleteFormData, | 216 profile_->GetPrefs()->SetBoolean(prefs::kDeleteFormData, |
216 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)) ? | 217 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)) ? |
217 true : false); | 218 true : false); |
218 } else if (widget == time_period_combobox_) { | 219 } else if (widget == time_period_combobox_) { |
219 profile_->GetPrefs()->SetInteger(prefs::kDeleteTimePeriod, | 220 profile_->GetPrefs()->SetInteger(prefs::kDeleteTimePeriod, |
220 gtk_combo_box_get_active(GTK_COMBO_BOX(widget))); | 221 gtk_combo_box_get_active(GTK_COMBO_BOX(widget))); |
221 } | 222 } |
222 } | 223 } |
OLD | NEW |