diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-19 22:19:05 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-19 22:19:05 +0000 |
commit | 78e48a70d7c0da64d9b2d5ebf71c750340c91378 (patch) | |
tree | ba14d1b5f8078ff72d5e788c27c55209848f134e /chrome | |
parent | 451f25aa20d8b975794461dd0f811fa63246b774 (diff) | |
download | chromium_src-78e48a70d7c0da64d9b2d5ebf71c750340c91378.zip chromium_src-78e48a70d7c0da64d9b2d5ebf71c750340c91378.tar.gz chromium_src-78e48a70d7c0da64d9b2d5ebf71c750340c91378.tar.bz2 |
Add option to enable/disable reporting.
BUG=11507
Review URL: http://codereview.chromium.org/115522
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16420 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/gtk/options/options_window_gtk.cc | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/chrome/browser/gtk/options/options_window_gtk.cc b/chrome/browser/gtk/options/options_window_gtk.cc index 19ec9c7..89c03ad 100644 --- a/chrome/browser/gtk/options/options_window_gtk.cc +++ b/chrome/browser/gtk/options/options_window_gtk.cc @@ -33,11 +33,18 @@ class OptionsWindowGtk { void ShowOptionsPage(OptionsPage page, OptionsGroup highlight_group); private: + // This is the callback function for Stats reporting checkbox. + static void OnLoggingChange(GtkWidget* widget, + OptionsWindowGtk* options_window); + static void OnSwitchPage(GtkNotebook* notebook, GtkNotebookPage* page, guint page_num, OptionsWindowGtk* options_window); static void OnWindowDestroy(GtkWidget* widget, OptionsWindowGtk* window); + // This function gets called when stats reporting option is changed. + void LoggingChanged(GtkWidget* widget); + // The options dialog GtkWidget *dialog_; @@ -106,9 +113,18 @@ OptionsWindowGtk::OptionsWindowGtk(Profile* profile) } #endif + GtkWidget* metrics_vbox = gtk_vbox_new(FALSE, 5); + GtkWidget* metrics = gtk_check_button_new_with_label( + l10n_util::GetStringUTF8(IDS_OPTIONS_ENABLE_LOGGING).c_str()); + gtk_box_pack_start(GTK_BOX(metrics_vbox), metrics, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(metrics_vbox), + gtk_label_new("TODO rest of the advanced options"), + FALSE, FALSE, 0); + g_signal_connect(metrics, "clicked", G_CALLBACK(OnLoggingChange), this); + gtk_notebook_append_page( GTK_NOTEBOOK(notebook_), - gtk_label_new("TODO advanced"), + metrics_vbox, gtk_label_new( l10n_util::GetStringUTF8(IDS_OPTIONS_ADVANCED_TAB_LABEL).c_str())); @@ -161,6 +177,12 @@ void OptionsWindowGtk::ShowOptionsPage(OptionsPage page, // OptionsWindowGtk, private: // static +void OptionsWindowGtk::OnLoggingChange(GtkWidget* widget, + OptionsWindowGtk* options_window) { + options_window->LoggingChanged(widget); +} + +// static void OptionsWindowGtk::OnSwitchPage(GtkNotebook* notebook, GtkNotebookPage* page, guint page_num, @@ -177,6 +199,15 @@ void OptionsWindowGtk::OnWindowDestroy(GtkWidget* widget, MessageLoop::current()->DeleteSoon(FROM_HERE, options_window); } +void OptionsWindowGtk::LoggingChanged(GtkWidget* metrics) { + // TODO: Once crash reporting is working for Linux, make the actual call to + // enable/disable it. + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(metrics))) + LOG(INFO) << "Reporting enabled"; + else + LOG(INFO) << "Reporting disabled"; +} + /////////////////////////////////////////////////////////////////////////////// // Factory/finder method: |