summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-18 13:06:38 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-18 13:06:38 +0000
commit03c379af76cb72a4f59dc4631182104da6bbdd4f (patch)
treee9e28e41e2bcdff67a5db0822989529406d75670 /chrome/browser
parentca0ebd7a43a22a6c3a13e22fb849fbc49a76a084 (diff)
downloadchromium_src-03c379af76cb72a4f59dc4631182104da6bbdd4f.zip
chromium_src-03c379af76cb72a4f59dc4631182104da6bbdd4f.tar.gz
chromium_src-03c379af76cb72a4f59dc4631182104da6bbdd4f.tar.bz2
gtk: Make use of gtk signal macros in FirstRunDialog.
BUG=None TEST=manually. Run out/Debug/chrome --first-run. Everything should works as before. Review URL: http://codereview.chromium.org/1998013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47507 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/gtk/first_run_dialog.cc10
-rw-r--r--chrome/browser/gtk/first_run_dialog.h17
2 files changed, 10 insertions, 17 deletions
diff --git a/chrome/browser/gtk/first_run_dialog.cc b/chrome/browser/gtk/first_run_dialog.cc
index 6f3e3d7..ed4dfb9 100644
--- a/chrome/browser/gtk/first_run_dialog.cc
+++ b/chrome/browser/gtk/first_run_dialog.cc
@@ -39,7 +39,7 @@ bool FirstRunDialog::Show(Profile* profile,
// http://code.google.com/p/chromium/issues/detail?id=12552
// Instead, run a loop and extract the response manually.
g_signal_connect(first_run->dialog_, "response",
- G_CALLBACK(HandleOnResponseDialog), first_run);
+ G_CALLBACK(OnResponseDialogThunk), first_run);
gtk_widget_show_all(first_run->dialog_);
MessageLoop::current()->Run();
@@ -95,7 +95,7 @@ FirstRunDialog::FirstRunDialog(Profile* profile, int& response)
gtk_util::IndentWidget(learn_more_link),
FALSE, FALSE, 0);
g_signal_connect(learn_more_link, "clicked",
- G_CALLBACK(OnLearnMoreLinkClicked), this);
+ G_CALLBACK(OnLearnMoreLinkClickedThunk), this);
report_crashes_ = gtk_check_button_new();
gtk_container_add(GTK_CONTAINER(report_crashes_), check_label);
@@ -140,7 +140,7 @@ FirstRunDialog::FirstRunDialog(Profile* profile, int& response)
gtk_box_pack_start(GTK_BOX(content_area), vbox, FALSE, FALSE, 0);
}
-void FirstRunDialog::OnDialogResponse(GtkWidget* widget, int response) {
+void FirstRunDialog::OnResponseDialog(GtkWidget* widget, int response) {
bool import_started = false;
gtk_widget_hide_all(dialog_);
response_ = response;
@@ -183,9 +183,7 @@ void FirstRunDialog::OnDialogResponse(GtkWidget* widget, int response) {
FirstRunDone();
}
-// static
-void FirstRunDialog::OnLearnMoreLinkClicked(GtkButton *button,
- FirstRunDialog* first_run) {
+void FirstRunDialog::OnLearnMoreLinkClicked(GtkButton* button) {
platform_util::OpenExternal(GURL(
l10n_util::GetStringUTF8(IDS_LEARN_MORE_REPORTING_URL)));
}
diff --git a/chrome/browser/gtk/first_run_dialog.h b/chrome/browser/gtk/first_run_dialog.h
index fb77c87..a2b2a70 100644
--- a/chrome/browser/gtk/first_run_dialog.h
+++ b/chrome/browser/gtk/first_run_dialog.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,6 +8,7 @@
typedef struct _GtkButton GtkButton;
typedef struct _GtkWidget GtkWidget;
+#include "app/gtk_signal.h"
#include "chrome/browser/first_run.h"
#include "chrome/browser/importer/importer.h"
@@ -16,7 +17,7 @@ class FirstRunDialog : public ImportObserver {
// Displays the first run UI for reporting opt-in, import data etc.
static bool Show(Profile* profile, ProcessSingleton* process_singleton);
- // Overridden methods from ImportObserver.
+ // Overridden from ImportObserver:
virtual void ImportCanceled() {
FirstRunDone();
}
@@ -26,16 +27,10 @@ class FirstRunDialog : public ImportObserver {
private:
FirstRunDialog(Profile* profile, int& response);
- ~FirstRunDialog() { }
+ ~FirstRunDialog() {}
- static void HandleOnResponseDialog(GtkWidget* widget,
- int response,
- FirstRunDialog* user_data) {
- user_data->OnDialogResponse(widget, response);
- }
- void OnDialogResponse(GtkWidget* widget, int response);
- static void OnLearnMoreLinkClicked(GtkButton *button,
- FirstRunDialog* first_run);
+ CHROMEGTK_CALLBACK_1(FirstRunDialog, void, OnResponseDialog, int);
+ CHROMEG_CALLBACK_0(FirstRunDialog, void, OnLearnMoreLinkClicked, GtkButton*);
// This method closes the first run window and quits the message loop so that
// the Chrome startup can continue. This should be called when all the