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/options/content_page_gtk.h" | 5 #include "chrome/browser/gtk/options/content_page_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 "base/gfx/gtk_util.h" | 9 #include "base/gfx/gtk_util.h" |
10 #include "chrome/browser/gtk/clear_browsing_data_dialog_gtk.h" | 10 #include "chrome/browser/gtk/clear_browsing_data_dialog_gtk.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 g_signal_connect(G_OBJECT(clear_data_button), "clicked", | 164 g_signal_connect(G_OBJECT(clear_data_button), "clicked", |
165 G_CALLBACK(OnClearBrowsingDataButtonClicked), this); | 165 G_CALLBACK(OnClearBrowsingDataButtonClicked), this); |
166 gtk_box_pack_start(GTK_BOX(button_hbox), clear_data_button, FALSE, FALSE, 0); | 166 gtk_box_pack_start(GTK_BOX(button_hbox), clear_data_button, FALSE, FALSE, 0); |
167 | 167 |
168 return vbox; | 168 return vbox; |
169 } | 169 } |
170 | 170 |
171 GtkWidget* ContentPageGtk::InitThemesGroup() { | 171 GtkWidget* ContentPageGtk::InitThemesGroup() { |
172 GtkWidget* hbox = gtk_hbox_new(FALSE, gtk_util::kLabelSpacing); | 172 GtkWidget* hbox = gtk_hbox_new(FALSE, gtk_util::kLabelSpacing); |
173 | 173 |
| 174 // GTK theme button. |
| 175 GtkWidget* gtk_theme_button = gtk_button_new_with_label("GTK Theme"); |
| 176 g_signal_connect(G_OBJECT(gtk_theme_button), "clicked", |
| 177 G_CALLBACK(OnGtkThemeButtonClicked), this); |
| 178 gtk_box_pack_start(GTK_BOX(hbox), gtk_theme_button, FALSE, FALSE, 0); |
| 179 |
174 // Reset themes button. | 180 // Reset themes button. |
175 GtkWidget* themes_reset_button = gtk_button_new_with_label( | 181 GtkWidget* themes_reset_button = gtk_button_new_with_label( |
176 l10n_util::GetStringUTF8(IDS_THEMES_RESET_BUTTON).c_str()); | 182 l10n_util::GetStringUTF8(IDS_THEMES_RESET_BUTTON).c_str()); |
177 g_signal_connect(G_OBJECT(themes_reset_button), "clicked", | 183 g_signal_connect(G_OBJECT(themes_reset_button), "clicked", |
178 G_CALLBACK(OnResetDefaultThemeButtonClicked), this); | 184 G_CALLBACK(OnResetDefaultThemeButtonClicked), this); |
179 gtk_box_pack_start(GTK_BOX(hbox), themes_reset_button, FALSE, FALSE, 0); | 185 gtk_box_pack_start(GTK_BOX(hbox), themes_reset_button, FALSE, FALSE, 0); |
180 | 186 |
181 return hbox; | 187 return hbox; |
182 } | 188 } |
183 | 189 |
184 // static | 190 // static |
185 void ContentPageGtk::OnImportButtonClicked(GtkButton* widget, | 191 void ContentPageGtk::OnImportButtonClicked(GtkButton* widget, |
186 ContentPageGtk* page) { | 192 ContentPageGtk* page) { |
187 ImportDialogGtk::Show( | 193 ImportDialogGtk::Show( |
188 GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(widget))), | 194 GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(widget))), |
189 page->profile()); | 195 page->profile()); |
190 } | 196 } |
191 | 197 |
192 // static | 198 // static |
193 void ContentPageGtk::OnClearBrowsingDataButtonClicked(GtkButton* widget, | 199 void ContentPageGtk::OnClearBrowsingDataButtonClicked(GtkButton* widget, |
194 ContentPageGtk* page) { | 200 ContentPageGtk* page) { |
195 ClearBrowsingDataDialogGtk::Show( | 201 ClearBrowsingDataDialogGtk::Show( |
196 GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(widget))), | 202 GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(widget))), |
197 page->profile()); | 203 page->profile()); |
198 } | 204 } |
199 | 205 |
200 // static | 206 // static |
| 207 void ContentPageGtk::OnGtkThemeButtonClicked(GtkButton* widget, |
| 208 ContentPageGtk* page) { |
| 209 page->UserMetricsRecordAction(L"Options_GtkThemeSet", |
| 210 page->profile()->GetPrefs()); |
| 211 page->profile()->SetNativeTheme(); |
| 212 } |
| 213 |
| 214 // static |
201 void ContentPageGtk::OnResetDefaultThemeButtonClicked(GtkButton* widget, | 215 void ContentPageGtk::OnResetDefaultThemeButtonClicked(GtkButton* widget, |
202 ContentPageGtk* page) { | 216 ContentPageGtk* page) { |
203 page->UserMetricsRecordAction(L"Options_ThemesReset", | 217 page->UserMetricsRecordAction(L"Options_ThemesReset", |
204 page->profile()->GetPrefs()); | 218 page->profile()->GetPrefs()); |
205 page->profile()->ClearTheme(); | 219 page->profile()->ClearTheme(); |
206 } | 220 } |
207 | 221 |
208 // static | 222 // static |
209 void ContentPageGtk::OnPasswordsExceptionsButtonClicked(GtkButton* widget, | 223 void ContentPageGtk::OnPasswordsExceptionsButtonClicked(GtkButton* widget, |
210 ContentPageGtk* page) { | 224 ContentPageGtk* page) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 GTK_TOGGLE_BUTTON(page->form_autofill_asktosave_radio_)); | 265 GTK_TOGGLE_BUTTON(page->form_autofill_asktosave_radio_)); |
252 if (enabled) { | 266 if (enabled) { |
253 page->UserMetricsRecordAction(L"Options_FormAutofill_Enable", | 267 page->UserMetricsRecordAction(L"Options_FormAutofill_Enable", |
254 page->profile()->GetPrefs()); | 268 page->profile()->GetPrefs()); |
255 } else { | 269 } else { |
256 page->UserMetricsRecordAction(L"Options_FormAutofill_Disable", | 270 page->UserMetricsRecordAction(L"Options_FormAutofill_Disable", |
257 page->profile()->GetPrefs()); | 271 page->profile()->GetPrefs()); |
258 } | 272 } |
259 page->ask_to_save_form_autofill_.SetValue(enabled); | 273 page->ask_to_save_form_autofill_.SetValue(enabled); |
260 } | 274 } |
OLD | NEW |