summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-02 02:02:41 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-02 02:02:41 +0000
commita8b8598f94bd49c3684bde66bf062fc38a658c4a (patch)
tree3bf1208df590e7bc867c200b638a81e59224e320 /chrome/browser/gtk
parenta7837ccc9c5db0b7a6f67bfbc420731aaef3ce04 (diff)
downloadchromium_src-a8b8598f94bd49c3684bde66bf062fc38a658c4a.zip
chromium_src-a8b8598f94bd49c3684bde66bf062fc38a658c4a.tar.gz
chromium_src-a8b8598f94bd49c3684bde66bf062fc38a658c4a.tar.bz2
gtk: Make use of gtk signal macros in BrowserTitleBar.
BUG=None TEST=trybots and manually Review URL: http://codereview.chromium.org/2448001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48689 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r--chrome/browser/gtk/browser_titlebar.cc28
-rw-r--r--chrome/browser/gtk/browser_titlebar.h13
2 files changed, 17 insertions, 24 deletions
diff --git a/chrome/browser/gtk/browser_titlebar.cc b/chrome/browser/gtk/browser_titlebar.cc
index f3d0fa0..a7abbf5 100644
--- a/chrome/browser/gtk/browser_titlebar.cc
+++ b/chrome/browser/gtk/browser_titlebar.cc
@@ -200,10 +200,10 @@ void BrowserTitlebar::Init() {
gtk_event_box_set_visible_window(GTK_EVENT_BOX(container_), FALSE);
gtk_container_add(GTK_CONTAINER(container_), container_hbox_);
- g_signal_connect(container_, "scroll-event", G_CALLBACK(OnScroll), this);
+ g_signal_connect(container_, "scroll-event", G_CALLBACK(OnScrollThunk), this);
g_signal_connect(window_, "window-state-event",
- G_CALLBACK(OnWindowStateChanged), this);
+ G_CALLBACK(OnWindowStateChangedThunk), this);
// Allocate the two button boxes on the left and right parts of the bar.
titlebar_left_buttons_vbox_ = gtk_vbox_new(FALSE, 0);
@@ -256,7 +256,7 @@ void BrowserTitlebar::Init() {
GtkWidget* favicon_event_box = gtk_event_box_new();
gtk_event_box_set_visible_window(GTK_EVENT_BOX(favicon_event_box), FALSE);
g_signal_connect(favicon_event_box, "button-press-event",
- G_CALLBACK(OnButtonPressed), this);
+ G_CALLBACK(OnButtonPressedThunk), this);
gtk_box_pack_start(GTK_BOX(app_mode_hbox), favicon_event_box, FALSE,
FALSE, 0);
// We use the app logo as a placeholder image so the title doesn't jump
@@ -631,20 +631,16 @@ void BrowserTitlebar::UpdateMaximizeRestoreVisibility() {
}
}
-// static
gboolean BrowserTitlebar::OnWindowStateChanged(GtkWindow* window,
- GdkEventWindowState* event, BrowserTitlebar* titlebar) {
- titlebar->UpdateMaximizeRestoreVisibility();
- titlebar->UpdateTitlebarAlignment();
- titlebar->UpdateTextColor();
+ GdkEventWindowState* event) {
+ UpdateMaximizeRestoreVisibility();
+ UpdateTitlebarAlignment();
+ UpdateTextColor();
return FALSE;
}
-// static
-gboolean BrowserTitlebar::OnScroll(GtkWidget* widget, GdkEventScroll* event,
- BrowserTitlebar* titlebar) {
- TabStripModel* tabstrip_model =
- titlebar->browser_window_->browser()->tabstrip_model();
+gboolean BrowserTitlebar::OnScroll(GtkWidget* widget, GdkEventScroll* event) {
+ TabStripModel* tabstrip_model = browser_window_->browser()->tabstrip_model();
int index = tabstrip_model->selected_index();
if (event->direction == GDK_SCROLL_LEFT ||
event->direction == GDK_SCROLL_UP) {
@@ -669,14 +665,12 @@ void BrowserTitlebar::OnButtonClicked(GtkWidget* button) {
}
}
-// static
gboolean BrowserTitlebar::OnButtonPressed(GtkWidget* widget,
- GdkEventButton* event,
- BrowserTitlebar* titlebar) {
+ GdkEventButton* event) {
if (event->button != 1)
return FALSE;
- titlebar->ShowFaviconMenu(event);
+ ShowFaviconMenu(event);
return TRUE;
}
diff --git a/chrome/browser/gtk/browser_titlebar.h b/chrome/browser/gtk/browser_titlebar.h
index bccbd6e..86f99d5 100644
--- a/chrome/browser/gtk/browser_titlebar.h
+++ b/chrome/browser/gtk/browser_titlebar.h
@@ -124,20 +124,19 @@ class BrowserTitlebar : public NotificationObserver,
// Callback for changes to window state. This includes
// maximizing/restoring/minimizing the window.
- static gboolean OnWindowStateChanged(GtkWindow* window,
- GdkEventWindowState* event,
- BrowserTitlebar* titlebar);
+ CHROMEG_CALLBACK_1(BrowserTitlebar, gboolean, OnWindowStateChanged,
+ GtkWindow*, GdkEventWindowState*);
// Callback for mousewheel events.
- static gboolean OnScroll(GtkWidget* widget, GdkEventScroll* event,
- BrowserTitlebar* titlebar);
+ CHROMEGTK_CALLBACK_1(BrowserTitlebar, gboolean, OnScroll,
+ GdkEventScroll*);
// Callback for min/max/close buttons.
CHROMEGTK_CALLBACK_0(BrowserTitlebar, void, OnButtonClicked);
// Callback for favicon.
- static gboolean OnButtonPressed(GtkWidget* widget, GdkEventButton* event,
- BrowserTitlebar* titlebar);
+ CHROMEGTK_CALLBACK_1(BrowserTitlebar, gboolean, OnButtonPressed,
+ GdkEventButton*);
// -- Context Menu -----------------------------------------------------------