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" |
11 #include "chrome/common/gtk_util.h" | 11 #include "chrome/common/gtk_util.h" |
12 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
13 #include "chrome/common/pref_service.h" | 13 #include "chrome/common/pref_service.h" |
14 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
15 | 15 |
16 // static | 16 // static |
17 void ClearBrowsingDataDialogGtk::Show(GtkWindow* parent, Profile* profile) { | 17 void ClearBrowsingDataDialogGtk::Show(GtkWindow* parent, Profile* profile) { |
18 new ClearBrowsingDataDialogGtk(parent, profile); | 18 new ClearBrowsingDataDialogGtk(parent, profile); |
19 } | 19 } |
20 | 20 |
21 ClearBrowsingDataDialogGtk::ClearBrowsingDataDialogGtk(GtkWindow* parent, | 21 ClearBrowsingDataDialogGtk::ClearBrowsingDataDialogGtk(GtkWindow* parent, |
22 Profile* profile) : | 22 Profile* profile) : |
23 profile_(profile), remover_(NULL) { | 23 profile_(profile), remover_(NULL) { |
24 // Build the dialog. | 24 // Build the dialog. |
25 GtkWidget* dialog = gtk_dialog_new_with_buttons( | 25 GtkWidget* dialog = gtk_dialog_new_with_buttons( |
26 l10n_util::GetStringUTF8(IDS_CLEAR_BROWSING_DATA_TITLE).c_str(), | 26 l10n_util::GetStringUTF8(IDS_CLEAR_BROWSING_DATA_TITLE).c_str(), |
27 parent, | 27 parent, |
28 (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR), | 28 (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR), |
29 GTK_STOCK_CANCEL, | 29 GTK_STOCK_CLOSE, |
30 GTK_RESPONSE_REJECT, | 30 GTK_RESPONSE_REJECT, |
31 l10n_util::GetStringUTF8(IDS_CLEAR_BROWSING_DATA_COMMIT).c_str(), | 31 l10n_util::GetStringUTF8(IDS_CLEAR_BROWSING_DATA_COMMIT).c_str(), |
32 GTK_RESPONSE_ACCEPT, | 32 GTK_RESPONSE_ACCEPT, |
33 NULL); | 33 NULL); |
34 | 34 |
35 GtkWidget* content_area = GTK_DIALOG(dialog)->vbox; | 35 GtkWidget* content_area = GTK_DIALOG(dialog)->vbox; |
36 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); | 36 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); |
37 | 37 |
38 GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); | 38 GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); |
39 gtk_container_add(GTK_CONTAINER(content_area), vbox); | 39 gtk_container_add(GTK_CONTAINER(content_area), vbox); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 true : false); | 190 true : false); |
191 } else if (widget == del_form_data_checkbox_) { | 191 } else if (widget == del_form_data_checkbox_) { |
192 profile_->GetPrefs()->SetBoolean(prefs::kDeleteFormData, | 192 profile_->GetPrefs()->SetBoolean(prefs::kDeleteFormData, |
193 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)) ? | 193 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)) ? |
194 true : false); | 194 true : false); |
195 } else if (widget == time_period_combobox_) { | 195 } else if (widget == time_period_combobox_) { |
196 profile_->GetPrefs()->SetInteger(prefs::kDeleteTimePeriod, | 196 profile_->GetPrefs()->SetInteger(prefs::kDeleteTimePeriod, |
197 gtk_combo_box_get_active(GTK_COMBO_BOX(widget))); | 197 gtk_combo_box_get_active(GTK_COMBO_BOX(widget))); |
198 } | 198 } |
199 } | 199 } |
OLD | NEW |