diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-29 16:38:34 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-29 16:38:34 +0000 |
commit | fb48743a5b534cf52934816e3405fe89262516ca (patch) | |
tree | f8d52fc888b81770f6d2c69cd55ddf97b2de1c64 /views/controls | |
parent | bd6d99a40c955ec7e7253fed69c719f22a460c91 (diff) | |
download | chromium_src-fb48743a5b534cf52934816e3405fe89262516ca.zip chromium_src-fb48743a5b534cf52934816e3405fe89262516ca.tar.gz chromium_src-fb48743a5b534cf52934816e3405fe89262516ca.tar.bz2 |
views: Make use of gtk_signal macros in more places.
BUG=None
TEST=compiles, and manually.
Patch from Thiago Farina <thiago.farina@gmail.com>
Review URL: http://codereview.chromium.org/1648016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45942 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
-rw-r--r-- | views/controls/button/native_button_gtk.cc | 11 | ||||
-rw-r--r-- | views/controls/button/native_button_gtk.h | 5 | ||||
-rw-r--r-- | views/controls/combobox/native_combobox_gtk.cc | 8 | ||||
-rw-r--r-- | views/controls/combobox/native_combobox_gtk.h | 5 |
4 files changed, 14 insertions, 15 deletions
diff --git a/views/controls/button/native_button_gtk.cc b/views/controls/button/native_button_gtk.cc index 4a54fc5..d25f444 100644 --- a/views/controls/button/native_button_gtk.cc +++ b/views/controls/button/native_button_gtk.cc @@ -96,7 +96,7 @@ gfx::Size NativeButtonGtk::GetPreferredSize() { void NativeButtonGtk::CreateNativeControl() { GtkWidget* widget = gtk_button_new(); g_signal_connect(widget, "clicked", - G_CALLBACK(CallClicked), this); + G_CALLBACK(CallClickedThunk), this); // Any push button can become the default button. GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_DEFAULT); @@ -112,9 +112,8 @@ void NativeButtonGtk::NativeControlCreated(GtkWidget* widget) { UpdateDefault(); } -// static -void NativeButtonGtk::CallClicked(GtkButton* widget, NativeButtonGtk* button) { - button->OnClicked(); +void NativeButtonGtk::CallClicked(GtkButton* widget) { + OnClicked(); } void NativeButtonGtk::OnClicked() { @@ -140,7 +139,7 @@ Checkbox* NativeCheckboxGtk::checkbox() { void NativeCheckboxGtk::CreateNativeControl() { GtkWidget* widget = gtk_check_button_new(); g_signal_connect(widget, "clicked", - G_CALLBACK(CallClicked), this); + G_CALLBACK(CallClickedThunk), this); NativeControlCreated(widget); } @@ -192,7 +191,7 @@ RadioButton* NativeRadioButtonGtk::radio_button() { void NativeRadioButtonGtk::CreateNativeControl() { GtkWidget* widget = gtk_radio_button_new(NULL); g_signal_connect(widget, "clicked", - G_CALLBACK(CallClicked), this); + G_CALLBACK(CallClickedThunk), this); g_signal_connect(widget, "toggled", G_CALLBACK(CallToggled), this); NativeControlCreated(widget); diff --git a/views/controls/button/native_button_gtk.h b/views/controls/button/native_button_gtk.h index 8a92b92..6d0a2e3 100644 --- a/views/controls/button/native_button_gtk.h +++ b/views/controls/button/native_button_gtk.h @@ -1,10 +1,11 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this +// 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. #ifndef VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_GTK_H_ #define VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_GTK_H_ +#include "app/gtk_signal.h" #include "views/controls/button/native_button_wrapper.h" #include "views/controls/native_control_gtk.h" @@ -31,7 +32,7 @@ class NativeButtonGtk : public NativeControlGtk, public NativeButtonWrapper { virtual gfx::Size GetPreferredSize(); protected: - static void CallClicked(GtkButton* widget, NativeButtonGtk* button); + CHROMEG_CALLBACK_0(NativeButtonGtk, void, CallClicked, GtkButton*); virtual void CreateNativeControl(); virtual void NativeControlCreated(GtkWidget* widget); diff --git a/views/controls/combobox/native_combobox_gtk.cc b/views/controls/combobox/native_combobox_gtk.cc index fd0526a..61e187a 100644 --- a/views/controls/combobox/native_combobox_gtk.cc +++ b/views/controls/combobox/native_combobox_gtk.cc @@ -113,7 +113,7 @@ void NativeComboboxGtk::CreateNativeControl() { gtk_cell_layout_set_attributes( GTK_CELL_LAYOUT(widget), cell, "text", 0, NULL); g_signal_connect(widget, "changed", - G_CALLBACK(CallChanged), this); + G_CALLBACK(CallChangedThunk), this); NativeControlCreated(widget); } @@ -132,10 +132,8 @@ void NativeComboboxGtk::SelectionChanged() { combobox_->SelectionChanged(); } -// static -void NativeComboboxGtk::CallChanged(GtkWidget* widget, - NativeComboboxGtk* combo) { - combo->SelectionChanged(); +void NativeComboboxGtk::CallChanged(GtkWidget* widget) { + SelectionChanged(); } //////////////////////////////////////////////////////////////////////////////// diff --git a/views/controls/combobox/native_combobox_gtk.h b/views/controls/combobox/native_combobox_gtk.h index 9e754d2..589cac6 100644 --- a/views/controls/combobox/native_combobox_gtk.h +++ b/views/controls/combobox/native_combobox_gtk.h @@ -1,10 +1,11 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this +// 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. #ifndef VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_GTK_H_ #define VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_GTK_H_ +#include "app/gtk_signal.h" #include "views/controls/combobox/native_combobox_wrapper.h" #include "views/controls/native_control_gtk.h" @@ -35,7 +36,7 @@ class NativeComboboxGtk : public NativeControlGtk, private: void SelectionChanged(); - static void CallChanged(GtkWidget* widget, NativeComboboxGtk* combo); + CHROMEGTK_CALLBACK_0(NativeComboboxGtk, void, CallChanged); // The combobox we are bound to. Combobox* combobox_; |