OLD | NEW |
1 // Copyright (c) 2010 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/clear_browsing_data_dialog_gtk.h" | 5 #include "chrome/browser/gtk/clear_browsing_data_dialog_gtk.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 ClearBrowsingDataDialogGtk::ClearBrowsingDataDialogGtk(GtkWindow* parent, | 37 ClearBrowsingDataDialogGtk::ClearBrowsingDataDialogGtk(GtkWindow* parent, |
38 Profile* profile) : | 38 Profile* profile) : |
39 profile_(profile), remover_(NULL) { | 39 profile_(profile), remover_(NULL) { |
40 // Build the dialog. | 40 // Build the dialog. |
41 std::string dialog_name = l10n_util::GetStringUTF8( | 41 std::string dialog_name = l10n_util::GetStringUTF8( |
42 IDS_CLEAR_BROWSING_DATA_TITLE); | 42 IDS_CLEAR_BROWSING_DATA_TITLE); |
43 dialog_ = gtk_dialog_new_with_buttons( | 43 dialog_ = gtk_dialog_new_with_buttons( |
44 dialog_name.c_str(), | 44 dialog_name.c_str(), |
45 parent, | 45 parent, |
46 (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR), | 46 (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR), |
47 GTK_STOCK_CLOSE, | |
48 GTK_RESPONSE_REJECT, | |
49 NULL); | 47 NULL); |
50 | 48 |
| 49 GtkWidget* close_button = gtk_dialog_add_button(GTK_DIALOG(dialog_), |
| 50 GTK_STOCK_CLOSE, GTK_RESPONSE_REJECT); |
| 51 gtk_widget_grab_focus(close_button); |
| 52 |
51 accessible_widget_helper_.reset(new AccessibleWidgetHelper(dialog_, profile)); | 53 accessible_widget_helper_.reset(new AccessibleWidgetHelper(dialog_, profile)); |
52 accessible_widget_helper_->SendOpenWindowNotification(dialog_name); | 54 accessible_widget_helper_->SendOpenWindowNotification(dialog_name); |
53 | 55 |
54 gtk_util::AddButtonToDialog(dialog_, | 56 gtk_util::AddButtonToDialog(dialog_, |
55 l10n_util::GetStringUTF8(IDS_CLEAR_BROWSING_DATA_COMMIT).c_str(), | 57 l10n_util::GetStringUTF8(IDS_CLEAR_BROWSING_DATA_COMMIT).c_str(), |
56 GTK_STOCK_APPLY, GTK_RESPONSE_ACCEPT); | 58 GTK_STOCK_APPLY, GTK_RESPONSE_ACCEPT); |
57 | 59 |
58 GtkWidget* content_area = GTK_DIALOG(dialog_)->vbox; | 60 GtkWidget* content_area = GTK_DIALOG(dialog_)->vbox; |
59 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); | 61 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); |
60 | 62 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 if (IsChecked(del_cookies_checkbox_)) | 252 if (IsChecked(del_cookies_checkbox_)) |
251 items |= BrowsingDataRemover::REMOVE_COOKIES; | 253 items |= BrowsingDataRemover::REMOVE_COOKIES; |
252 if (IsChecked(del_passwords_checkbox_)) | 254 if (IsChecked(del_passwords_checkbox_)) |
253 items |= BrowsingDataRemover::REMOVE_PASSWORDS; | 255 items |= BrowsingDataRemover::REMOVE_PASSWORDS; |
254 if (IsChecked(del_form_data_checkbox_)) | 256 if (IsChecked(del_form_data_checkbox_)) |
255 items |= BrowsingDataRemover::REMOVE_FORM_DATA; | 257 items |= BrowsingDataRemover::REMOVE_FORM_DATA; |
256 if (IsChecked(del_cache_checkbox_)) | 258 if (IsChecked(del_cache_checkbox_)) |
257 items |= BrowsingDataRemover::REMOVE_CACHE; | 259 items |= BrowsingDataRemover::REMOVE_CACHE; |
258 return items; | 260 return items; |
259 } | 261 } |
OLD | NEW |