From e5a2acec061119fab8f5b0a05e79702ae03670dc Mon Sep 17 00:00:00 2001 From: "erg@chromium.org" Date: Wed, 10 Feb 2010 17:47:41 +0000 Subject: Remove redundant casts in g_signal_connect() throughout all gtk code we have. BUG=none TEST=none Review URL: http://codereview.chromium.org/600033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38629 0039d316-1c4b-4281-b951-d872f2087c98 --- .../autocomplete/autocomplete_edit_view_gtk.cc | 8 +++---- chrome/browser/chromeos/panel_controller.cc | 4 ++-- chrome/browser/gtk/bookmark_bar_gtk.cc | 16 ++++++------- chrome/browser/gtk/bookmark_editor_gtk.cc | 4 ++-- chrome/browser/gtk/bookmark_menu_controller_gtk.cc | 12 +++++----- chrome/browser/gtk/browser_titlebar.cc | 3 +-- chrome/browser/gtk/browser_window_gtk.cc | 2 +- chrome/browser/gtk/certificate_viewer.cc | 4 ++-- chrome/browser/gtk/content_blocked_bubble_gtk.cc | 4 ++-- chrome/browser/gtk/custom_button.cc | 2 +- chrome/browser/gtk/dialogs_gtk.cc | 8 +++---- chrome/browser/gtk/download_item_gtk.cc | 2 +- chrome/browser/gtk/edit_search_engine_dialog.cc | 8 +++---- chrome/browser/gtk/find_bar_gtk.cc | 6 ++--- chrome/browser/gtk/first_run_dialog.cc | 4 ++-- chrome/browser/gtk/keyword_editor_view.cc | 12 +++++----- chrome/browser/gtk/menu_gtk.cc | 4 ++-- .../browser/gtk/notifications/balloon_view_gtk.cc | 4 ++-- .../browser/gtk/options/advanced_contents_gtk.cc | 2 +- chrome/browser/gtk/options/advanced_page_gtk.cc | 2 +- chrome/browser/gtk/options/content_page_gtk.cc | 28 +++++++++++----------- chrome/browser/gtk/options/cookies_view.cc | 12 +++++----- chrome/browser/gtk/options/exceptions_page_gtk.cc | 6 ++--- chrome/browser/gtk/options/fonts_page_gtk.cc | 2 +- chrome/browser/gtk/options/general_page_gtk.cc | 28 +++++++++++----------- chrome/browser/gtk/options/languages_page_gtk.cc | 16 ++++++------- chrome/browser/gtk/options/passwords_page_gtk.cc | 8 +++---- .../browser/gtk/options/url_picker_dialog_gtk.cc | 6 ++--- chrome/browser/gtk/process_singleton_dialog.cc | 3 +-- chrome/browser/gtk/rounded_window.cc | 4 ++-- chrome/browser/gtk/tabs/dragged_tab_gtk.cc | 2 +- chrome/browser/gtk/tabs/tab_gtk.cc | 8 +++---- chrome/browser/gtk/tabs/tab_renderer_gtk.cc | 12 +++++----- chrome/browser/gtk/tabs/tab_strip_gtk.cc | 18 +++++++------- chrome/browser/gtk/task_manager_gtk.cc | 12 +++++----- chrome/browser/input_window_dialog_gtk.cc | 2 +- chrome/common/gtk_util.cc | 4 ++-- 37 files changed, 140 insertions(+), 142 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc index 39815fa..102854d 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc @@ -574,9 +574,9 @@ void AutocompleteEditViewGtk::SetBaseColor() { GdkColor average_color = gtk_util::AverageColors( style->text[GTK_STATE_NORMAL], style->base[GTK_STATE_NORMAL]); - g_object_set(G_OBJECT(faded_text_tag_), "foreground-gdk", + g_object_set(faded_text_tag_, "foreground-gdk", &average_color, NULL); - g_object_set(G_OBJECT(normal_text_tag_), "foreground-gdk", + g_object_set(normal_text_tag_, "foreground-gdk", &style->text[GTK_STATE_NORMAL], NULL); } else { #if defined(TOOLKIT_VIEWS) @@ -589,8 +589,8 @@ void AutocompleteEditViewGtk::SetBaseColor() { &LocationBarViewGtk::kBackgroundColorByLevel[scheme_security_level_]); #endif - g_object_set(G_OBJECT(faded_text_tag_), "foreground", kTextBaseColor, NULL); - g_object_set(G_OBJECT(normal_text_tag_), "foreground", "#000000", NULL); + g_object_set(faded_text_tag_, "foreground", kTextBaseColor, NULL); + g_object_set(normal_text_tag_, "foreground", "#000000", NULL); } } diff --git a/chrome/browser/chromeos/panel_controller.cc b/chrome/browser/chromeos/panel_controller.cc index a8c5d76..0019fbf 100644 --- a/chrome/browser/chromeos/panel_controller.cc +++ b/chrome/browser/chromeos/panel_controller.cc @@ -110,8 +110,8 @@ void PanelController::Init(const gfx::Rect window_bounds) { TabOverviewTypes::WINDOW_TYPE_CHROME_PANEL_CONTENT, &type_params); - g_signal_connect( - G_OBJECT(panel_), "client-event", G_CALLBACK(OnPanelClientEvent), this); + g_signal_connect(panel_, "client-event", + G_CALLBACK(OnPanelClientEvent), this); title_content_ = new TitleContentView(this); title_window_->SetContentsView(title_content_); diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc index de8e8a2..f0fddbd 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.cc +++ b/chrome/browser/gtk/bookmark_bar_gtk.cc @@ -271,7 +271,7 @@ void BookmarkBarGtk::Init(Profile* profile) { GTK_BUTTON(sync_error_button_), gtk_image_new_from_pixbuf( ResourceBundle::GetSharedInstance().GetPixbufNamed(IDR_WARNING))); - g_signal_connect(G_OBJECT(sync_error_button_), "button-press-event", + g_signal_connect(sync_error_button_, "button-press-event", G_CALLBACK(OnSyncErrorButtonPressed), this); gtk_box_pack_start(GTK_BOX(bookmark_hbox_), sync_error_button_ , FALSE, FALSE, 0); @@ -825,11 +825,11 @@ GtkWidget* BookmarkBarGtk::CreateBookmarkButton(const BookmarkNode* node) { GtkDndUtil::NETSCAPE_URL; } GtkDndUtil::SetSourceTargetListFromCodeMask(button, target_mask); - g_signal_connect(G_OBJECT(button), "drag-begin", + g_signal_connect(button, "drag-begin", G_CALLBACK(&OnButtonDragBegin), this); - g_signal_connect(G_OBJECT(button), "drag-end", + g_signal_connect(button, "drag-end", G_CALLBACK(&OnButtonDragEnd), this); - g_signal_connect(G_OBJECT(button), "drag-data-get", + g_signal_connect(button, "drag-data-get", G_CALLBACK(&OnButtonDragGet), this); // We deliberately don't connect to "drag-data-delete" because the action of // moving a button will regenerate all the contents of the bookmarks bar @@ -839,9 +839,9 @@ GtkWidget* BookmarkBarGtk::CreateBookmarkButton(const BookmarkNode* node) { // Connect to 'button-release-event' instead of 'clicked' because we need // access to the modifier keys and we do different things on each // button. - g_signal_connect(G_OBJECT(button), "button-press-event", + g_signal_connect(button, "button-press-event", G_CALLBACK(OnButtonPressed), this); - g_signal_connect(G_OBJECT(button), "clicked", + g_signal_connect(button, "clicked", G_CALLBACK(OnClicked), this); gtk_util::SetButtonTriggersNavigation(button); } else { @@ -869,9 +869,9 @@ void BookmarkBarGtk::ConnectFolderButtonEvents(GtkWidget* widget) { g_signal_connect(widget, "drag-data-received", G_CALLBACK(&OnDragReceived), this); - g_signal_connect(G_OBJECT(widget), "button-press-event", + g_signal_connect(widget, "button-press-event", G_CALLBACK(OnButtonPressed), this); - g_signal_connect(G_OBJECT(widget), "clicked", + g_signal_connect(widget, "clicked", G_CALLBACK(OnFolderClicked), this); // Accept middle mouse clicking (which opens all). This must be called after diff --git a/chrome/browser/gtk/bookmark_editor_gtk.cc b/chrome/browser/gtk/bookmark_editor_gtk.cc index 6dd3957..b976579 100644 --- a/chrome/browser/gtk/bookmark_editor_gtk.cc +++ b/chrome/browser/gtk/bookmark_editor_gtk.cc @@ -140,7 +140,7 @@ void BookmarkEditorGtk::Init(GtkWindow* parent_window) { l10n_util::GetString(IDS_BOOMARK_EDITOR_NEW_FOLDER_NAME)); } gtk_entry_set_text(GTK_ENTRY(name_entry_), title.c_str()); - g_signal_connect(G_OBJECT(name_entry_), "changed", + g_signal_connect(name_entry_, "changed", G_CALLBACK(OnEntryChanged), this); gtk_entry_set_activates_default(GTK_ENTRY(name_entry_), TRUE); @@ -151,7 +151,7 @@ void BookmarkEditorGtk::Init(GtkWindow* parent_window) { if (details_.type == EditDetails::EXISTING_NODE) url_spec = details_.existing_node->GetURL().spec(); gtk_entry_set_text(GTK_ENTRY(url_entry_), url_spec.c_str()); - g_signal_connect(G_OBJECT(url_entry_), "changed", + g_signal_connect(url_entry_, "changed", G_CALLBACK(OnEntryChanged), this); gtk_entry_set_activates_default(GTK_ENTRY(url_entry_), TRUE); table = gtk_util::CreateLabeledControlsGroup(NULL, diff --git a/chrome/browser/gtk/bookmark_menu_controller_gtk.cc b/chrome/browser/gtk/bookmark_menu_controller_gtk.cc index a6232ac..06bf2ef 100644 --- a/chrome/browser/gtk/bookmark_menu_controller_gtk.cc +++ b/chrome/browser/gtk/bookmark_menu_controller_gtk.cc @@ -157,7 +157,7 @@ void BookmarkMenuController::BuildMenu(const BookmarkNode* parent, DCHECK(!parent->GetChildCount() || start_child_index < parent->GetChildCount()); - g_signal_connect(G_OBJECT(menu), "button-press-event", + g_signal_connect(menu, "button-press-event", G_CALLBACK(OnButtonPressed), this); for (int i = start_child_index; i < parent->GetChildCount(); ++i) { @@ -174,9 +174,9 @@ void BookmarkMenuController::BuildMenu(const BookmarkNode* parent, gtk_util::SetAlwaysShowImage(menu_item); if (node->is_url()) { - g_signal_connect(G_OBJECT(menu_item), "activate", + g_signal_connect(menu_item, "activate", G_CALLBACK(OnMenuItemActivated), this); - g_signal_connect(G_OBJECT(menu_item), "button-release-event", + g_signal_connect(menu_item, "button-release-event", G_CALLBACK(OnButtonReleased), this); } else if (node->is_folder()) { GtkWidget* submenu = gtk_menu_new(); @@ -192,11 +192,11 @@ void BookmarkMenuController::BuildMenu(const BookmarkNode* parent, if (node->is_url()) target_mask |= GtkDndUtil::TEXT_URI_LIST | GtkDndUtil::NETSCAPE_URL; GtkDndUtil::SetSourceTargetListFromCodeMask(menu_item, target_mask); - g_signal_connect(G_OBJECT(menu_item), "drag-begin", + g_signal_connect(menu_item, "drag-begin", G_CALLBACK(&OnMenuItemDragBegin), this); - g_signal_connect(G_OBJECT(menu_item), "drag-end", + g_signal_connect(menu_item, "drag-end", G_CALLBACK(&OnMenuItemDragEnd), this); - g_signal_connect(G_OBJECT(menu_item), "drag-data-get", + g_signal_connect(menu_item, "drag-data-get", G_CALLBACK(&OnMenuItemDragGet), this); gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item); diff --git a/chrome/browser/gtk/browser_titlebar.cc b/chrome/browser/gtk/browser_titlebar.cc index 36b7005..8e8f69f 100644 --- a/chrome/browser/gtk/browser_titlebar.cc +++ b/chrome/browser/gtk/browser_titlebar.cc @@ -172,8 +172,7 @@ 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(G_OBJECT(container_), "scroll-event", - G_CALLBACK(OnScroll), this); + g_signal_connect(container_, "scroll-event", G_CALLBACK(OnScroll), this); g_signal_connect(window_, "window-state-event", G_CALLBACK(OnWindowStateChanged), this); diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 267f93d..c370b66 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -1441,7 +1441,7 @@ void BrowserWindowGtk::InitWidgets() { gtk_widget_set_app_paintable(window_container_, TRUE); gtk_widget_set_double_buffered(window_container_, FALSE); gtk_widget_set_redraw_on_allocate(window_container_, TRUE); - g_signal_connect(G_OBJECT(window_container_), "expose-event", + g_signal_connect(window_container_, "expose-event", G_CALLBACK(&OnCustomFrameExpose), this); gtk_container_add(GTK_CONTAINER(window_container_), window_vbox_); diff --git a/chrome/browser/gtk/certificate_viewer.cc b/chrome/browser/gtk/certificate_viewer.cc index ce97ac6..9be1f65 100644 --- a/chrome/browser/gtk/certificate_viewer.cc +++ b/chrome/browser/gtk/certificate_viewer.cc @@ -770,7 +770,7 @@ void CertificateViewer::InitDetailsPage() { GtkTreeSelection* hierarchy_selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(hierarchy_tree)); gtk_tree_selection_set_mode(hierarchy_selection, GTK_SELECTION_SINGLE); - g_signal_connect(G_OBJECT(hierarchy_selection), "changed", + g_signal_connect(hierarchy_selection, "changed", G_CALLBACK(OnHierarchySelectionChanged), this); GtkWidget* hierarchy_scroll_window = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(hierarchy_scroll_window), @@ -800,7 +800,7 @@ void CertificateViewer::InitDetailsPage() { GtkTreeSelection* fields_selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(fields_tree_)); gtk_tree_selection_set_mode(fields_selection, GTK_SELECTION_SINGLE); - g_signal_connect(G_OBJECT(fields_selection), "changed", + g_signal_connect(fields_selection, "changed", G_CALLBACK(OnFieldsSelectionChanged), this); GtkWidget* fields_scroll_window = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(fields_scroll_window), diff --git a/chrome/browser/gtk/content_blocked_bubble_gtk.cc b/chrome/browser/gtk/content_blocked_bubble_gtk.cc index dbfa7bc..6f81658 100644 --- a/chrome/browser/gtk/content_blocked_bubble_gtk.cc +++ b/chrome/browser/gtk/content_blocked_bubble_gtk.cc @@ -137,9 +137,9 @@ void ContentBlockedBubbleGtk::BuildBubble() { content_type_) == CONTENT_SETTING_ALLOW) ? allow_radio_ : block_radio_), TRUE); - g_signal_connect(G_OBJECT(allow_radio_), "toggled", + g_signal_connect(allow_radio_, "toggled", G_CALLBACK(OnAllowBlockToggled), this); - g_signal_connect(G_OBJECT(block_radio_), "toggled", + g_signal_connect(block_radio_, "toggled", G_CALLBACK(OnAllowBlockToggled), this); } diff --git a/chrome/browser/gtk/custom_button.cc b/chrome/browser/gtk/custom_button.cc index 413ccd7..33a3a0e2 100644 --- a/chrome/browser/gtk/custom_button.cc +++ b/chrome/browser/gtk/custom_button.cc @@ -177,7 +177,7 @@ CustomDrawButton::~CustomDrawButton() { void CustomDrawButton::Init() { widget_.Own(gtk_chrome_button_new()); GTK_WIDGET_UNSET_FLAGS(widget_.get(), GTK_CAN_FOCUS); - g_signal_connect(G_OBJECT(widget_.get()), "expose-event", + g_signal_connect(widget_.get(), "expose-event", G_CALLBACK(OnCustomExpose), this); } diff --git a/chrome/browser/gtk/dialogs_gtk.cc b/chrome/browser/gtk/dialogs_gtk.cc index 4b37b4b..ef577c8 100644 --- a/chrome/browser/gtk/dialogs_gtk.cc +++ b/chrome/browser/gtk/dialogs_gtk.cc @@ -349,7 +349,7 @@ GtkWidget* SelectFileDialogImpl::CreateSelectFolderDialog( last_opened_path_->value().c_str()); } gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); - g_signal_connect(G_OBJECT(dialog), "response", + g_signal_connect(dialog, "response", G_CALLBACK(OnSelectSingleFolderDialogResponse), this); return dialog; } @@ -377,7 +377,7 @@ GtkWidget* SelectFileDialogImpl::CreateFileOpenDialog(const std::string& title, last_opened_path_->value().c_str()); } gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); - g_signal_connect(G_OBJECT(dialog), "response", + g_signal_connect(dialog, "response", G_CALLBACK(OnSelectSingleFileDialogResponse), this); return dialog; } @@ -407,7 +407,7 @@ GtkWidget* SelectFileDialogImpl::CreateMultiFileOpenDialog( last_opened_path_->value().c_str()); } gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), TRUE); - g_signal_connect(G_OBJECT(dialog), "response", + g_signal_connect(dialog, "response", G_CALLBACK(OnSelectMultiFileDialogResponse), this); return dialog; } @@ -440,7 +440,7 @@ GtkWidget* SelectFileDialogImpl::CreateSaveAsDialog(const std::string& title, gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dialog), TRUE); - g_signal_connect(G_OBJECT(dialog), "response", + g_signal_connect(dialog, "response", G_CALLBACK(OnSelectSingleFileDialogResponse), this); return dialog; } diff --git a/chrome/browser/gtk/download_item_gtk.cc b/chrome/browser/gtk/download_item_gtk.cc index 7cb1112..b40daf6 100644 --- a/chrome/browser/gtk/download_item_gtk.cc +++ b/chrome/browser/gtk/download_item_gtk.cc @@ -259,7 +259,7 @@ DownloadItemGtk::DownloadItemGtk(DownloadShelfGtk* parent_shelf, gtk_box_pack_start(GTK_BOX(shelf_hbox), hbox_.get(), FALSE, FALSE, 0); // Insert as the leftmost item. gtk_box_reorder_child(GTK_BOX(shelf_hbox), hbox_.get(), 1); - g_signal_connect(G_OBJECT(shelf_hbox), "size-allocate", + g_signal_connect(shelf_hbox, "size-allocate", G_CALLBACK(OnShelfResized), this); get_download()->AddObserver(this); diff --git a/chrome/browser/gtk/edit_search_engine_dialog.cc b/chrome/browser/gtk/edit_search_engine_dialog.cc index b23489a..1aa3576 100644 --- a/chrome/browser/gtk/edit_search_engine_dialog.cc +++ b/chrome/browser/gtk/edit_search_engine_dialog.cc @@ -108,19 +108,19 @@ void EditSearchEngineDialog::Init(GtkWindow* parent_window) { title_entry_ = gtk_entry_new(); gtk_entry_set_activates_default(GTK_ENTRY(title_entry_), TRUE); - g_signal_connect(G_OBJECT(title_entry_), "changed", + g_signal_connect(title_entry_, "changed", G_CALLBACK(OnEntryChanged), this); keyword_entry_ = gtk_entry_new(); gtk_entry_set_activates_default(GTK_ENTRY(keyword_entry_), TRUE); - g_signal_connect(G_OBJECT(keyword_entry_), "changed", + g_signal_connect(keyword_entry_, "changed", G_CALLBACK(OnEntryChanged), this); - g_signal_connect(G_OBJECT(keyword_entry_), "insert-text", + g_signal_connect(keyword_entry_, "insert-text", G_CALLBACK(LowercaseInsertTextHandler), NULL); url_entry_ = gtk_entry_new(); gtk_entry_set_activates_default(GTK_ENTRY(url_entry_), TRUE); - g_signal_connect(G_OBJECT(url_entry_), "changed", + g_signal_connect(url_entry_, "changed", G_CALLBACK(OnEntryChanged), this); title_image_ = gtk_image_new_from_pixbuf(NULL); diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc index 9a9ff9c..ee8d715 100644 --- a/chrome/browser/gtk/find_bar_gtk.cc +++ b/chrome/browser/gtk/find_bar_gtk.cc @@ -221,7 +221,7 @@ void FindBarGtk::InitWidgets() { close_button_.reset(CustomDrawButton::CloseButton(theme_provider_)); gtk_util::CenterWidgetInHBox(hbox, close_button_->widget(), true, kCloseButtonPaddingLeft); - g_signal_connect(G_OBJECT(close_button_->widget()), "clicked", + g_signal_connect(close_button_->widget(), "clicked", G_CALLBACK(OnClicked), this); gtk_widget_set_tooltip_text(close_button_->widget(), l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP).c_str()); @@ -229,7 +229,7 @@ void FindBarGtk::InitWidgets() { find_next_button_.reset(new CustomDrawButton(theme_provider_, IDR_FINDINPAGE_NEXT, IDR_FINDINPAGE_NEXT_H, IDR_FINDINPAGE_NEXT_H, IDR_FINDINPAGE_NEXT_P, 0, GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_MENU)); - g_signal_connect(G_OBJECT(find_next_button_->widget()), "clicked", + g_signal_connect(find_next_button_->widget(), "clicked", G_CALLBACK(OnClicked), this); gtk_widget_set_tooltip_text(find_next_button_->widget(), l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_NEXT_TOOLTIP).c_str()); @@ -239,7 +239,7 @@ void FindBarGtk::InitWidgets() { find_previous_button_.reset(new CustomDrawButton(theme_provider_, IDR_FINDINPAGE_PREV, IDR_FINDINPAGE_PREV_H, IDR_FINDINPAGE_PREV_H, IDR_FINDINPAGE_PREV_P, 0, GTK_STOCK_GO_UP, GTK_ICON_SIZE_MENU)); - g_signal_connect(G_OBJECT(find_previous_button_->widget()), "clicked", + g_signal_connect(find_previous_button_->widget(), "clicked", G_CALLBACK(OnClicked), this); gtk_widget_set_tooltip_text(find_previous_button_->widget(), l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP).c_str()); diff --git a/chrome/browser/gtk/first_run_dialog.cc b/chrome/browser/gtk/first_run_dialog.cc index a38cb06..d8c1375 100644 --- a/chrome/browser/gtk/first_run_dialog.cc +++ b/chrome/browser/gtk/first_run_dialog.cc @@ -36,7 +36,7 @@ bool FirstRunDialog::Show(Profile* profile, // but that spins a nested message loop and hoses us. :( // http://code.google.com/p/chromium/issues/detail?id=12552 // Instead, run a loop and extract the response manually. - g_signal_connect(G_OBJECT(first_run->dialog_), "response", + g_signal_connect(first_run->dialog_, "response", G_CALLBACK(HandleOnResponseDialog), first_run); gtk_widget_show_all(first_run->dialog_); MessageLoop::current()->Run(); @@ -72,7 +72,7 @@ FirstRunDialog::FirstRunDialog(Profile* profile, int& response) // manually: gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); - g_signal_connect(G_OBJECT(dialog_), "delete-event", + g_signal_connect(dialog_, "delete-event", G_CALLBACK(gtk_widget_hide_on_delete), NULL); GtkWidget* content_area = GTK_DIALOG(dialog_)->vbox; diff --git a/chrome/browser/gtk/keyword_editor_view.cc b/chrome/browser/gtk/keyword_editor_view.cc index 541782b..4482216 100644 --- a/chrome/browser/gtk/keyword_editor_view.cc +++ b/chrome/browser/gtk/keyword_editor_view.cc @@ -112,7 +112,7 @@ void KeywordEditorView::Init() { gtk_tree_view_set_row_separator_func(GTK_TREE_VIEW(tree_), OnCheckRowIsSeparator, NULL, NULL); - g_signal_connect(G_OBJECT(tree_), "row-activated", + g_signal_connect(tree_, "row-activated", G_CALLBACK(OnRowActivated), this); gtk_container_add(GTK_CONTAINER(scroll_window), tree_); @@ -146,7 +146,7 @@ void KeywordEditorView::Init() { gtk_tree_selection_set_mode(selection_, GTK_SELECTION_SINGLE); gtk_tree_selection_set_select_function(selection_, OnSelectionFilter, NULL, NULL); - g_signal_connect(G_OBJECT(selection_), "changed", + g_signal_connect(selection_, "changed", G_CALLBACK(OnSelectionChanged), this); GtkWidget* button_box = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); @@ -156,13 +156,13 @@ void KeywordEditorView::Init() { gtk_util::ConvertAcceleratorsFromWindowsStyle( l10n_util::GetStringUTF8( IDS_SEARCH_ENGINES_EDITOR_NEW_BUTTON)).c_str()); - g_signal_connect(G_OBJECT(add_button_), "clicked", + g_signal_connect(add_button_, "clicked", G_CALLBACK(OnAddButtonClicked), this); gtk_box_pack_start(GTK_BOX(button_box), add_button_, FALSE, FALSE, 0); edit_button_ = gtk_button_new_with_label( l10n_util::GetStringUTF8(IDS_SEARCH_ENGINES_EDITOR_EDIT_BUTTON).c_str()); - g_signal_connect(G_OBJECT(edit_button_), "clicked", + g_signal_connect(edit_button_, "clicked", G_CALLBACK(OnEditButtonClicked), this); gtk_box_pack_start(GTK_BOX(button_box), edit_button_, FALSE, FALSE, 0); @@ -170,14 +170,14 @@ void KeywordEditorView::Init() { gtk_util::ConvertAcceleratorsFromWindowsStyle( l10n_util::GetStringUTF8( IDS_SEARCH_ENGINES_EDITOR_REMOVE_BUTTON)).c_str()); - g_signal_connect(G_OBJECT(remove_button_), "clicked", + g_signal_connect(remove_button_, "clicked", G_CALLBACK(OnRemoveButtonClicked), this); gtk_box_pack_start(GTK_BOX(button_box), remove_button_, FALSE, FALSE, 0); make_default_button_ = gtk_button_new_with_label( l10n_util::GetStringUTF8( IDS_SEARCH_ENGINES_EDITOR_MAKE_DEFAULT_BUTTON).c_str()); - g_signal_connect(G_OBJECT(make_default_button_), "clicked", + g_signal_connect(make_default_button_, "clicked", G_CALLBACK(OnMakeDefaultButtonClicked), this); gtk_box_pack_start(GTK_BOX(button_box), make_default_button_, FALSE, FALSE, 0); diff --git a/chrome/browser/gtk/menu_gtk.cc b/chrome/browser/gtk/menu_gtk.cc index 324f37e..7d1f0ef 100644 --- a/chrome/browser/gtk/menu_gtk.cc +++ b/chrome/browser/gtk/menu_gtk.cc @@ -168,7 +168,7 @@ void MenuGtk::AppendMenuItemToMenu(int command_id, GtkWidget* menu_item, GtkWidget* menu) { SetMenuItemID(menu_item, command_id); - g_signal_connect(G_OBJECT(menu_item), "activate", + g_signal_connect(menu_item, "activate", G_CALLBACK(OnMenuItemActivated), this); gtk_widget_show(menu_item); @@ -277,7 +277,7 @@ void MenuGtk::BuildMenuIn(GtkWidget* menu, g_object_set_data(G_OBJECT(menu_item), "menu-data", const_cast(menu_data)); - g_signal_connect(G_OBJECT(menu_item), "activate", + g_signal_connect(menu_item, "activate", G_CALLBACK(OnMenuItemActivated), this); gtk_widget_show(menu_item); diff --git a/chrome/browser/gtk/notifications/balloon_view_gtk.cc b/chrome/browser/gtk/notifications/balloon_view_gtk.cc index fb2d436..9cb4038 100644 --- a/chrome/browser/gtk/notifications/balloon_view_gtk.cc +++ b/chrome/browser/gtk/notifications/balloon_view_gtk.cc @@ -283,7 +283,7 @@ void BalloonViewImpl::Show(Balloon* balloon) { // Create a button for showing the options menu, and add it to the toolbar. options_menu_button_ = theme_provider->BuildChromeButton(); - g_signal_connect(G_OBJECT(options_menu_button_), "clicked", + g_signal_connect(options_menu_button_, "clicked", G_CALLBACK(HandleOptionsMenuButtonThunk), this); PrepareButtonWithIcon(options_menu_button_, options_text, IDR_BALLOON_OPTIONS_ARROW_HOVER); @@ -294,7 +294,7 @@ void BalloonViewImpl::Show(Balloon* balloon) { // Create a button to dismiss the balloon and add it to the toolbar. close_button_ = theme_provider->BuildChromeButton(); - g_signal_connect(G_OBJECT(close_button_), "clicked", + g_signal_connect(close_button_, "clicked", G_CALLBACK(HandleCloseButtonThunk), this); PrepareButtonWithIcon(close_button_, dismiss_text, IDR_BALLOON_CLOSE_HOVER); GtkToolItem* close_button_toolitem = gtk_tool_item_new(); diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.cc b/chrome/browser/gtk/options/advanced_contents_gtk.cc index 4f558f1..aaa8c7e 100644 --- a/chrome/browser/gtk/options/advanced_contents_gtk.cc +++ b/chrome/browser/gtk/options/advanced_contents_gtk.cc @@ -637,7 +637,7 @@ PrivacySection::PrivacySection(Profile* profile) gtk_combo_box_append_text( GTK_COMBO_BOX(cookie_behavior_combobox_), l10n_util::GetStringUTF8(IDS_OPTIONS_COOKIES_BLOCK_ALL_COOKIES).c_str()); - g_signal_connect(G_OBJECT(cookie_behavior_combobox_), "changed", + g_signal_connect(cookie_behavior_combobox_, "changed", G_CALLBACK(OnCookieBehaviorChanged), this); gtk_box_pack_start(GTK_BOX(cookie_controls), cookie_behavior_combobox_, FALSE, FALSE, 0); diff --git a/chrome/browser/gtk/options/advanced_page_gtk.cc b/chrome/browser/gtk/options/advanced_page_gtk.cc index 065c577..9bc8040 100644 --- a/chrome/browser/gtk/options/advanced_page_gtk.cc +++ b/chrome/browser/gtk/options/advanced_page_gtk.cc @@ -39,7 +39,7 @@ void AdvancedPageGtk::Init() { gtk_button_box_set_layout(GTK_BUTTON_BOX(button_box), GTK_BUTTONBOX_END); GtkWidget* reset_button = gtk_button_new_with_label( l10n_util::GetStringUTF8(IDS_OPTIONS_RESET).c_str()); - g_signal_connect(G_OBJECT(reset_button), "clicked", + g_signal_connect(reset_button, "clicked", G_CALLBACK(OnResetToDefaultsClicked), this); gtk_container_add(GTK_CONTAINER(button_box), reset_button); gtk_box_pack_start(GTK_BOX(page_), button_box, FALSE, FALSE, 0); diff --git a/chrome/browser/gtk/options/content_page_gtk.cc b/chrome/browser/gtk/options/content_page_gtk.cc index 7461cce..b577462 100644 --- a/chrome/browser/gtk/options/content_page_gtk.cc +++ b/chrome/browser/gtk/options/content_page_gtk.cc @@ -173,7 +173,7 @@ GtkWidget* ContentPageGtk::InitPasswordSavingGroup() { // Ask to save radio button. passwords_asktosave_radio_ = gtk_radio_button_new_with_label(NULL, l10n_util::GetStringUTF8(IDS_OPTIONS_PASSWORDS_ASKTOSAVE).c_str()); - g_signal_connect(G_OBJECT(passwords_asktosave_radio_), "toggled", + g_signal_connect(passwords_asktosave_radio_, "toggled", G_CALLBACK(OnPasswordRadioToggled), this); gtk_box_pack_start(GTK_BOX(vbox), passwords_asktosave_radio_, FALSE, FALSE, 0); @@ -182,7 +182,7 @@ GtkWidget* ContentPageGtk::InitPasswordSavingGroup() { passwords_neversave_radio_ = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON(passwords_asktosave_radio_), l10n_util::GetStringUTF8(IDS_OPTIONS_PASSWORDS_NEVERSAVE).c_str()); - g_signal_connect(G_OBJECT(passwords_neversave_radio_), "toggled", + g_signal_connect(passwords_neversave_radio_, "toggled", G_CALLBACK(OnPasswordRadioToggled), this); gtk_box_pack_start(GTK_BOX(vbox), passwords_neversave_radio_, FALSE, FALSE, 0); @@ -193,7 +193,7 @@ GtkWidget* ContentPageGtk::InitPasswordSavingGroup() { gtk_container_add(GTK_CONTAINER(vbox), button_hbox); GtkWidget* passwords_exceptions_button = gtk_button_new_with_label( l10n_util::GetStringUTF8(IDS_OPTIONS_PASSWORDS_EXCEPTIONS).c_str()); - g_signal_connect(G_OBJECT(passwords_exceptions_button), "clicked", + g_signal_connect(passwords_exceptions_button, "clicked", G_CALLBACK(OnPasswordsExceptionsButtonClicked), this); gtk_box_pack_start(GTK_BOX(button_hbox), passwords_exceptions_button, FALSE, FALSE, 0); @@ -207,7 +207,7 @@ GtkWidget* ContentPageGtk::InitFormAutofillGroup() { // Ask to save radio button. form_autofill_asktosave_radio_ = gtk_radio_button_new_with_label(NULL, l10n_util::GetStringUTF8(IDS_OPTIONS_AUTOFILL_SAVE).c_str()); - g_signal_connect(G_OBJECT(form_autofill_asktosave_radio_), "toggled", + g_signal_connect(form_autofill_asktosave_radio_, "toggled", G_CALLBACK(OnAutofillRadioToggled), this); gtk_box_pack_start(GTK_BOX(vbox), form_autofill_asktosave_radio_, FALSE, FALSE, 0); @@ -216,7 +216,7 @@ GtkWidget* ContentPageGtk::InitFormAutofillGroup() { form_autofill_neversave_radio_ = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON(form_autofill_asktosave_radio_), l10n_util::GetStringUTF8(IDS_OPTIONS_AUTOFILL_NEVERSAVE).c_str()); - g_signal_connect(G_OBJECT(form_autofill_neversave_radio_), "toggled", + g_signal_connect(form_autofill_neversave_radio_, "toggled", G_CALLBACK(OnAutofillRadioToggled), this); gtk_box_pack_start(GTK_BOX(vbox), form_autofill_neversave_radio_, FALSE, FALSE, 0); @@ -234,7 +234,7 @@ GtkWidget* ContentPageGtk::InitBrowsingDataGroup() { // Import button. GtkWidget* import_button = gtk_button_new_with_label( l10n_util::GetStringUTF8(IDS_OPTIONS_IMPORT_DATA_BUTTON).c_str()); - g_signal_connect(G_OBJECT(import_button), "clicked", + g_signal_connect(import_button, "clicked", G_CALLBACK(OnImportButtonClicked), this); gtk_box_pack_start(GTK_BOX(button_hbox), import_button, FALSE, FALSE, 0); @@ -243,7 +243,7 @@ GtkWidget* ContentPageGtk::InitBrowsingDataGroup() { // Windows). GtkWidget* clear_data_button = gtk_button_new_with_label( l10n_util::GetStringUTF8(IDS_OPTIONS_PRIVACY_CLEAR_DATA_BUTTON).c_str()); - g_signal_connect(G_OBJECT(clear_data_button), "clicked", + g_signal_connect(clear_data_button, "clicked", G_CALLBACK(OnClearBrowsingDataButtonClicked), this); gtk_box_pack_start(GTK_BOX(button_hbox), clear_data_button, FALSE, FALSE, 0); @@ -258,7 +258,7 @@ GtkWidget* ContentPageGtk::InitThemesGroup() { // GTK theme button. gtk_theme_button_ = gtk_button_new_with_label( l10n_util::GetStringUTF8(IDS_THEMES_GTK_BUTTON).c_str()); - g_signal_connect(G_OBJECT(gtk_theme_button_), "clicked", + g_signal_connect(gtk_theme_button_, "clicked", G_CALLBACK(OnGtkThemeButtonClicked), this); gtk_box_pack_start(GTK_BOX(hbox), gtk_theme_button_, FALSE, FALSE, 0); #endif @@ -266,14 +266,14 @@ GtkWidget* ContentPageGtk::InitThemesGroup() { // Reset theme button. themes_reset_button_ = gtk_button_new_with_label( l10n_util::GetStringUTF8(IDS_THEMES_SET_CLASSIC).c_str()); - g_signal_connect(G_OBJECT(themes_reset_button_), "clicked", + g_signal_connect(themes_reset_button_, "clicked", G_CALLBACK(OnResetDefaultThemeButtonClicked), this); gtk_box_pack_start(GTK_BOX(hbox), themes_reset_button_, FALSE, FALSE, 0); // Get themes button. GtkWidget* themes_gallery_button = gtk_chrome_link_button_new( l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_BUTTON).c_str()); - g_signal_connect(G_OBJECT(themes_gallery_button), "clicked", + g_signal_connect(themes_gallery_button, "clicked", G_CALLBACK(OnGetThemesButtonClicked), this); gtk_box_pack_start(GTK_BOX(hbox), themes_gallery_button, FALSE, FALSE, 0); @@ -284,7 +284,7 @@ GtkWidget* ContentPageGtk::InitThemesGroup() { // Use system title bar and borders system_title_bar_show_radio_ = gtk_radio_button_new_with_label(NULL, l10n_util::GetStringUTF8(IDS_SHOW_WINDOW_DECORATIONS_RADIO).c_str()); - g_signal_connect(G_OBJECT(system_title_bar_show_radio_), "toggled", + g_signal_connect(system_title_bar_show_radio_, "toggled", G_CALLBACK(OnSystemTitleBarRadioToggled), this); gtk_box_pack_start(GTK_BOX(vbox), system_title_bar_show_radio_, FALSE, FALSE, 0); @@ -293,7 +293,7 @@ GtkWidget* ContentPageGtk::InitThemesGroup() { system_title_bar_hide_radio_ = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON(system_title_bar_show_radio_), l10n_util::GetStringUTF8(IDS_HIDE_WINDOW_DECORATIONS_RADIO).c_str()); - g_signal_connect(G_OBJECT(system_title_bar_hide_radio_), "toggled", + g_signal_connect(system_title_bar_hide_radio_, "toggled", G_CALLBACK(OnSystemTitleBarRadioToggled), this); gtk_box_pack_start(GTK_BOX(vbox), system_title_bar_hide_radio_, FALSE, FALSE, 0); @@ -321,7 +321,7 @@ GtkWidget* ContentPageGtk::InitSyncGroup() { GtkWidget* link_hbox = gtk_hbox_new(FALSE, gtk_util::kLabelSpacing); sync_action_link_background_ = gtk_event_box_new(); sync_action_link_ = gtk_chrome_link_button_new(""); - g_signal_connect(G_OBJECT(sync_action_link_), "clicked", + g_signal_connect(sync_action_link_, "clicked", G_CALLBACK(OnSyncActionLinkClicked), this); gtk_box_pack_start(GTK_BOX(vbox), link_hbox, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(link_hbox), sync_action_link_background_, FALSE, @@ -335,7 +335,7 @@ GtkWidget* ContentPageGtk::InitSyncGroup() { GtkWidget* button_hbox = gtk_hbox_new(FALSE, gtk_util::kLabelSpacing); gtk_container_add(GTK_CONTAINER(vbox), button_hbox); sync_start_stop_button_ = gtk_button_new_with_label(""); - g_signal_connect(G_OBJECT(sync_start_stop_button_), "clicked", + g_signal_connect(sync_start_stop_button_, "clicked", G_CALLBACK(OnSyncStartStopButtonClicked), this); gtk_box_pack_start(GTK_BOX(button_hbox), sync_start_stop_button_, FALSE, FALSE, 0); diff --git a/chrome/browser/gtk/options/cookies_view.cc b/chrome/browser/gtk/options/cookies_view.cc index 896e3b1..25abfa3 100644 --- a/chrome/browser/gtk/options/cookies_view.cc +++ b/chrome/browser/gtk/options/cookies_view.cc @@ -127,16 +127,16 @@ void CookiesView::Init() { // Filtering controls. GtkWidget* filter_hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); filter_entry_ = gtk_entry_new(); - g_signal_connect(G_OBJECT(filter_entry_), "activate", + g_signal_connect(filter_entry_, "activate", G_CALLBACK(OnFilterEntryActivated), this); - g_signal_connect(G_OBJECT(filter_entry_), "changed", + g_signal_connect(filter_entry_, "changed", G_CALLBACK(OnFilterEntryChanged), this); gtk_box_pack_start(GTK_BOX(filter_hbox), filter_entry_, TRUE, TRUE, 0); filter_clear_button_ = gtk_button_new_with_mnemonic( gtk_util::ConvertAcceleratorsFromWindowsStyle( l10n_util::GetStringUTF8(IDS_COOKIES_CLEAR_SEARCH_LABEL)).c_str()); - g_signal_connect(G_OBJECT(filter_clear_button_), "clicked", + g_signal_connect(filter_clear_button_, "clicked", G_CALLBACK(OnFilterClearButtonClicked), this); gtk_box_pack_start(GTK_BOX(filter_hbox), filter_clear_button_, FALSE, FALSE, 0); @@ -189,14 +189,14 @@ void CookiesView::Init() { title_column, l10n_util::GetStringUTF8( IDS_COOKIES_DOMAIN_COLUMN_HEADER).c_str()); gtk_tree_view_append_column(GTK_TREE_VIEW(tree_), title_column); - g_signal_connect(G_OBJECT(tree_), "key-press-event", + g_signal_connect(tree_, "key-press-event", G_CALLBACK(OnTreeViewKeyPress), this); - g_signal_connect(G_OBJECT(tree_), "row-expanded", + g_signal_connect(tree_, "row-expanded", G_CALLBACK(OnTreeViewRowExpanded), this); selection_ = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_)); gtk_tree_selection_set_mode(selection_, GTK_SELECTION_SINGLE); - g_signal_connect(G_OBJECT(selection_), "changed", + g_signal_connect(selection_, "changed", G_CALLBACK(OnSelectionChanged), this); // Cookie details. diff --git a/chrome/browser/gtk/options/exceptions_page_gtk.cc b/chrome/browser/gtk/options/exceptions_page_gtk.cc index 10a8f2d..2d29dfc 100644 --- a/chrome/browser/gtk/options/exceptions_page_gtk.cc +++ b/chrome/browser/gtk/options/exceptions_page_gtk.cc @@ -36,12 +36,12 @@ ExceptionsPageGtk::ExceptionsPageGtk(Profile* profile) remove_button_ = gtk_button_new_with_label( l10n_util::GetStringUTF8(IDS_EXCEPTIONS_PAGE_VIEW_REMOVE_BUTTON).c_str()); gtk_widget_set_sensitive(remove_button_, FALSE); - g_signal_connect(G_OBJECT(remove_button_), "clicked", + g_signal_connect(remove_button_, "clicked", G_CALLBACK(OnRemoveButtonClicked), this); remove_all_button_ = gtk_button_new_with_label(l10n_util::GetStringUTF8( IDS_EXCEPTIONS_PAGE_VIEW_REMOVE_ALL_BUTTON).c_str()); gtk_widget_set_sensitive(remove_all_button_, FALSE); - g_signal_connect(G_OBJECT(remove_all_button_), "clicked", + g_signal_connect(remove_all_button_, "clicked", G_CALLBACK(OnRemoveAllButtonClicked), this); GtkWidget* buttons = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); @@ -86,7 +86,7 @@ void ExceptionsPageGtk::InitExceptionTree() { GTK_TREE_VIEW(exception_tree_)); gtk_tree_selection_set_mode(exception_selection_, GTK_SELECTION_SINGLE); - g_signal_connect(G_OBJECT(exception_selection_), "changed", + g_signal_connect(exception_selection_, "changed", G_CALLBACK(OnExceptionSelectionChanged), this); GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( diff --git a/chrome/browser/gtk/options/fonts_page_gtk.cc b/chrome/browser/gtk/options/fonts_page_gtk.cc index 01008a5..03931b9 100644 --- a/chrome/browser/gtk/options/fonts_page_gtk.cc +++ b/chrome/browser/gtk/options/fonts_page_gtk.cc @@ -109,7 +109,7 @@ void FontsPageGtk::Init() { void FontsPageGtk::InitDefaultEncodingComboBox() { default_encoding_combobox_ = gtk_combo_box_new_text(); - g_signal_connect(G_OBJECT(default_encoding_combobox_), "changed", + g_signal_connect(default_encoding_combobox_, "changed", G_CALLBACK(OnDefaultEncodingChanged), this); int canonical_encoding_names_length = CharacterEncoding::GetSupportCanonicalEncodingCount(); diff --git a/chrome/browser/gtk/options/general_page_gtk.cc b/chrome/browser/gtk/options/general_page_gtk.cc index d9ae203..e00da54 100644 --- a/chrome/browser/gtk/options/general_page_gtk.cc +++ b/chrome/browser/gtk/options/general_page_gtk.cc @@ -180,14 +180,14 @@ GtkWidget* GeneralPageGtk::InitStartupGroup() { startup_homepage_radio_ = gtk_radio_button_new_with_label(NULL, l10n_util::GetStringUTF8( IDS_OPTIONS_STARTUP_SHOW_DEFAULT_AND_NEWTAB).c_str()); - g_signal_connect(G_OBJECT(startup_homepage_radio_), "toggled", + g_signal_connect(startup_homepage_radio_, "toggled", G_CALLBACK(OnStartupRadioToggled), this); gtk_box_pack_start(GTK_BOX(vbox), startup_homepage_radio_, FALSE, FALSE, 0); startup_last_session_radio_ = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON(startup_homepage_radio_), l10n_util::GetStringUTF8(IDS_OPTIONS_STARTUP_SHOW_LAST_SESSION).c_str()); - g_signal_connect(G_OBJECT(startup_last_session_radio_), "toggled", + g_signal_connect(startup_last_session_radio_, "toggled", G_CALLBACK(OnStartupRadioToggled), this); gtk_box_pack_start(GTK_BOX(vbox), startup_last_session_radio_, FALSE, FALSE, 0); @@ -195,7 +195,7 @@ GtkWidget* GeneralPageGtk::InitStartupGroup() { startup_custom_radio_ = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON(startup_homepage_radio_), l10n_util::GetStringUTF8(IDS_OPTIONS_STARTUP_SHOW_PAGES).c_str()); - g_signal_connect(G_OBJECT(startup_custom_radio_), "toggled", + g_signal_connect(startup_custom_radio_, "toggled", G_CALLBACK(OnStartupRadioToggled), this); gtk_box_pack_start(GTK_BOX(vbox), startup_custom_radio_, FALSE, FALSE, 0); @@ -238,7 +238,7 @@ GtkWidget* GeneralPageGtk::InitStartupGroup() { GTK_TREE_VIEW(startup_custom_pages_tree_)); gtk_tree_selection_set_mode(startup_custom_pages_selection_, GTK_SELECTION_MULTIPLE); - g_signal_connect(G_OBJECT(startup_custom_pages_selection_), "changed", + g_signal_connect(startup_custom_pages_selection_, "changed", G_CALLBACK(OnStartupPagesSelectionChanged), this); favicon_loader_.reset(new ListStoreFavIconLoader(startup_custom_pages_model_, COL_FAVICON, @@ -253,21 +253,21 @@ GtkWidget* GeneralPageGtk::InitStartupGroup() { startup_add_custom_page_button_ = gtk_button_new_with_mnemonic( gtk_util::ConvertAcceleratorsFromWindowsStyle( l10n_util::GetStringUTF8(IDS_OPTIONS_STARTUP_ADD_BUTTON)).c_str()); - g_signal_connect(G_OBJECT(startup_add_custom_page_button_), "clicked", + g_signal_connect(startup_add_custom_page_button_, "clicked", G_CALLBACK(OnStartupAddCustomPageClicked), this); gtk_box_pack_start(GTK_BOX(url_list_buttons), startup_add_custom_page_button_, FALSE, FALSE, 0); startup_remove_custom_page_button_ = gtk_button_new_with_mnemonic( gtk_util::ConvertAcceleratorsFromWindowsStyle( l10n_util::GetStringUTF8(IDS_OPTIONS_STARTUP_REMOVE_BUTTON)).c_str()); - g_signal_connect(G_OBJECT(startup_remove_custom_page_button_), "clicked", + g_signal_connect(startup_remove_custom_page_button_, "clicked", G_CALLBACK(OnStartupRemoveCustomPageClicked), this); gtk_box_pack_start(GTK_BOX(url_list_buttons), startup_remove_custom_page_button_, FALSE, FALSE, 0); startup_use_current_page_button_ = gtk_button_new_with_mnemonic( gtk_util::ConvertAcceleratorsFromWindowsStyle( l10n_util::GetStringUTF8(IDS_OPTIONS_STARTUP_USE_CURRENT)).c_str()); - g_signal_connect(G_OBJECT(startup_use_current_page_button_), "clicked", + g_signal_connect(startup_use_current_page_button_, "clicked", G_CALLBACK(OnStartupUseCurrentPageClicked), this); gtk_box_pack_start(GTK_BOX(url_list_buttons), startup_use_current_page_button_, FALSE, FALSE, 0); @@ -280,7 +280,7 @@ GtkWidget* GeneralPageGtk::InitHomepageGroup() { homepage_use_newtab_radio_ = gtk_radio_button_new_with_label(NULL, l10n_util::GetStringUTF8(IDS_OPTIONS_HOMEPAGE_USE_NEWTAB).c_str()); - g_signal_connect(G_OBJECT(homepage_use_newtab_radio_), "toggled", + g_signal_connect(homepage_use_newtab_radio_, "toggled", G_CALLBACK(OnNewTabIsHomePageToggled), this); gtk_container_add(GTK_CONTAINER(vbox), homepage_use_newtab_radio_); @@ -290,20 +290,20 @@ GtkWidget* GeneralPageGtk::InitHomepageGroup() { homepage_use_url_radio_ = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON(homepage_use_newtab_radio_), l10n_util::GetStringUTF8(IDS_OPTIONS_HOMEPAGE_USE_URL).c_str()); - g_signal_connect(G_OBJECT(homepage_use_url_radio_), "toggled", + g_signal_connect(homepage_use_url_radio_, "toggled", G_CALLBACK(OnNewTabIsHomePageToggled), this); gtk_box_pack_start(GTK_BOX(homepage_hbox), homepage_use_url_radio_, FALSE, FALSE, 0); homepage_use_url_entry_ = gtk_entry_new(); - g_signal_connect(G_OBJECT(homepage_use_url_entry_), "changed", + g_signal_connect(homepage_use_url_entry_, "changed", G_CALLBACK(OnHomepageUseUrlEntryChanged), this); gtk_box_pack_start(GTK_BOX(homepage_hbox), homepage_use_url_entry_, TRUE, TRUE, 0); homepage_show_home_button_checkbox_ = gtk_check_button_new_with_label( l10n_util::GetStringUTF8(IDS_OPTIONS_HOMEPAGE_SHOW_BUTTON).c_str()); - g_signal_connect(G_OBJECT(homepage_show_home_button_checkbox_), "toggled", + g_signal_connect(homepage_show_home_button_checkbox_, "toggled", G_CALLBACK(OnShowHomeButtonToggled), this); gtk_container_add(GTK_CONTAINER(vbox), homepage_show_home_button_checkbox_); @@ -319,7 +319,7 @@ GtkWidget* GeneralPageGtk::InitDefaultSearchGroup() { default_search_engine_combobox_ = gtk_combo_box_new_with_model( GTK_TREE_MODEL(default_search_engines_model_)); g_object_unref(default_search_engines_model_); - g_signal_connect(G_OBJECT(default_search_engine_combobox_), "changed", + g_signal_connect(default_search_engine_combobox_, "changed", G_CALLBACK(OnDefaultSearchEngineChanged), this); gtk_container_add(GTK_CONTAINER(hbox), default_search_engine_combobox_); @@ -341,7 +341,7 @@ GtkWidget* GeneralPageGtk::InitDefaultSearchGroup() { default_search_manage_engines_button_ = gtk_button_new_with_label( l10n_util::GetStringUTF8( IDS_OPTIONS_DEFAULTSEARCH_MANAGE_ENGINES_LINK).c_str()); - g_signal_connect(G_OBJECT(default_search_manage_engines_button_), "clicked", + g_signal_connect(default_search_manage_engines_button_, "clicked", G_CALLBACK(OnDefaultSearchManageEnginesClicked), this); gtk_box_pack_end(GTK_BOX(hbox), default_search_manage_engines_button_, FALSE, FALSE, 0); @@ -361,7 +361,7 @@ GtkWidget* GeneralPageGtk::InitDefaultBrowserGroup() { default_browser_use_as_default_button_ = gtk_button_new_with_label( l10n_util::GetStringFUTF8(IDS_OPTIONS_DEFAULTBROWSER_USEASDEFAULT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)).c_str()); - g_signal_connect(G_OBJECT(default_browser_use_as_default_button_), "clicked", + g_signal_connect(default_browser_use_as_default_button_, "clicked", G_CALLBACK(OnBrowserUseAsDefaultClicked), this); gtk_box_pack_start(GTK_BOX(vbox), default_browser_use_as_default_button_, diff --git a/chrome/browser/gtk/options/languages_page_gtk.cc b/chrome/browser/gtk/options/languages_page_gtk.cc index 3af1834..8ac6a3e 100644 --- a/chrome/browser/gtk/options/languages_page_gtk.cc +++ b/chrome/browser/gtk/options/languages_page_gtk.cc @@ -168,7 +168,7 @@ void LanguagesPageGtk::Init() { GTK_TREE_VIEW(language_order_tree_)); gtk_tree_selection_set_mode(language_order_selection_, GTK_SELECTION_MULTIPLE); - g_signal_connect(G_OBJECT(language_order_selection_), "changed", + g_signal_connect(language_order_selection_, "changed", G_CALLBACK(OnSelectionChanged), this); GtkWidget* scroll_window = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_window), @@ -193,7 +193,7 @@ void LanguagesPageGtk::Init() { add_button_ = gtk_button_new_with_label(l10n_util::GetStringUTF8( IDS_FONT_LANGUAGE_SETTING_LANGUAGES_SELECTOR_ADD_BUTTON_LABEL).c_str()); - g_signal_connect(G_OBJECT(add_button_), "clicked", + g_signal_connect(add_button_, "clicked", G_CALLBACK(OnAddButtonClicked), this); gtk_box_pack_start(GTK_BOX(languages_buttons_vbox), add_button_, FALSE, FALSE, 0); @@ -201,7 +201,7 @@ void LanguagesPageGtk::Init() { std::string remove_button_text = l10n_util::GetStringUTF8( IDS_FONT_LANGUAGE_SETTING_LANGUAGES_SELECTOR_REMOVE_BUTTON_LABEL); remove_button_ = gtk_button_new_with_label(remove_button_text.c_str()); - g_signal_connect(G_OBJECT(remove_button_), "clicked", + g_signal_connect(remove_button_, "clicked", G_CALLBACK(OnRemoveButtonClicked), this); gtk_box_pack_start(GTK_BOX(languages_buttons_vbox), remove_button_, FALSE, FALSE, 0); @@ -209,7 +209,7 @@ void LanguagesPageGtk::Init() { std::string move_up_button_text = l10n_util::GetStringUTF8( IDS_FONT_LANGUAGE_SETTING_LANGUAGES_SELECTOR_MOVEUP_BUTTON_LABEL); move_up_button_ = gtk_button_new_with_label(move_up_button_text.c_str()); - g_signal_connect(G_OBJECT(move_up_button_), "clicked", + g_signal_connect(move_up_button_, "clicked", G_CALLBACK(OnMoveUpButtonClicked), this); gtk_box_pack_start(GTK_BOX(languages_buttons_vbox), move_up_button_, FALSE, FALSE, 0); @@ -217,7 +217,7 @@ void LanguagesPageGtk::Init() { std::string move_down_button_text = l10n_util::GetStringUTF8( IDS_FONT_LANGUAGE_SETTING_LANGUAGES_SELECTOR_MOVEDOWN_BUTTON_LABEL); move_down_button_ = gtk_button_new_with_label(move_down_button_text.c_str()); - g_signal_connect(G_OBJECT(move_down_button_), "clicked", + g_signal_connect(move_down_button_, "clicked", G_CALLBACK(OnMoveDownButtonClicked), this); gtk_box_pack_start(GTK_BOX(languages_buttons_vbox), move_down_button_, FALSE, FALSE, 0); @@ -229,7 +229,7 @@ void LanguagesPageGtk::Init() { enable_spellchecking_checkbox_ = gtk_check_button_new_with_label( l10n_util::GetStringUTF8(IDS_OPTIONS_ENABLE_SPELLCHECK).c_str()); - g_signal_connect(G_OBJECT(enable_spellchecking_checkbox_), "toggled", + g_signal_connect(enable_spellchecking_checkbox_, "toggled", G_CALLBACK(OnEnableSpellCheckingToggled), this); gtk_box_pack_start(GTK_BOX(spellchecker_vbox), enable_spellchecking_checkbox_, FALSE, FALSE, 0); @@ -239,7 +239,7 @@ void LanguagesPageGtk::Init() { enable_autospellcorrect_checkbox_ = gtk_check_button_new_with_label( l10n_util::GetStringUTF8( IDS_OPTIONS_ENABLE_AUTO_SPELL_CORRECTION).c_str()); - g_signal_connect(G_OBJECT(enable_autospellcorrect_checkbox_), "toggled", + g_signal_connect(enable_autospellcorrect_checkbox_, "toggled", G_CALLBACK(OnEnableAutoSpellCheckingToggled), this); gtk_box_pack_start(GTK_BOX(spellchecker_vbox), enable_autospellcorrect_checkbox_, FALSE, FALSE, 0); @@ -251,7 +251,7 @@ void LanguagesPageGtk::Init() { spell_check_languages)); dictionary_language_combobox_ = NewComboboxFromModel( dictionary_language_model_.get()); - g_signal_connect(G_OBJECT(dictionary_language_combobox_), "changed", + g_signal_connect(dictionary_language_combobox_, "changed", G_CALLBACK(OnDictionaryLanguageChangedThunk), this); GtkWidget* dictionary_language_control = gtk_util::CreateLabeledControlsGroup(NULL, diff --git a/chrome/browser/gtk/options/passwords_page_gtk.cc b/chrome/browser/gtk/options/passwords_page_gtk.cc index c7ab52f..834fdbe 100644 --- a/chrome/browser/gtk/options/passwords_page_gtk.cc +++ b/chrome/browser/gtk/options/passwords_page_gtk.cc @@ -40,12 +40,12 @@ PasswordsPageGtk::PasswordsPageGtk(Profile* profile) remove_button_ = gtk_button_new_with_label( l10n_util::GetStringUTF8(IDS_PASSWORDS_PAGE_VIEW_REMOVE_BUTTON).c_str()); gtk_widget_set_sensitive(remove_button_, FALSE); - g_signal_connect(G_OBJECT(remove_button_), "clicked", + g_signal_connect(remove_button_, "clicked", G_CALLBACK(OnRemoveButtonClicked), this); remove_all_button_ = gtk_button_new_with_label(l10n_util::GetStringUTF8( IDS_PASSWORDS_PAGE_VIEW_REMOVE_ALL_BUTTON).c_str()); gtk_widget_set_sensitive(remove_all_button_, FALSE); - g_signal_connect(G_OBJECT(remove_all_button_), "clicked", + g_signal_connect(remove_all_button_, "clicked", G_CALLBACK(OnRemoveAllButtonClicked), this); show_password_button_ = gtk_button_new_with_label( @@ -66,7 +66,7 @@ PasswordsPageGtk::PasswordsPageGtk(Profile* profile) gtk_widget_set_size_request(show_password_button_, show_size.width, show_size.height); gtk_widget_set_sensitive(show_password_button_, FALSE); - g_signal_connect(G_OBJECT(show_password_button_), "clicked", + g_signal_connect(show_password_button_, "clicked", G_CALLBACK(OnShowPasswordButtonClicked), this); password_ = gtk_label_new(""); @@ -119,7 +119,7 @@ void PasswordsPageGtk::InitPasswordTree() { GTK_TREE_VIEW(password_tree_)); gtk_tree_selection_set_mode(password_selection_, GTK_SELECTION_SINGLE); - g_signal_connect(G_OBJECT(password_selection_), "changed", + g_signal_connect(password_selection_, "changed", G_CALLBACK(OnPasswordSelectionChanged), this); GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( diff --git a/chrome/browser/gtk/options/url_picker_dialog_gtk.cc b/chrome/browser/gtk/options/url_picker_dialog_gtk.cc index de472f8..026c29f 100644 --- a/chrome/browser/gtk/options/url_picker_dialog_gtk.cc +++ b/chrome/browser/gtk/options/url_picker_dialog_gtk.cc @@ -63,7 +63,7 @@ UrlPickerDialogGtk::UrlPickerDialogGtk(UrlPickerCallback* callback, FALSE, FALSE, 0); url_entry_ = gtk_entry_new(); gtk_entry_set_activates_default(GTK_ENTRY(url_entry_), TRUE); - g_signal_connect(G_OBJECT(url_entry_), "changed", + g_signal_connect(url_entry_, "changed", G_CALLBACK(OnUrlEntryChanged), this); gtk_box_pack_start(GTK_BOX(url_hbox), url_entry_, TRUE, TRUE, 0); @@ -108,14 +108,14 @@ UrlPickerDialogGtk::UrlPickerDialogGtk(UrlPickerCallback* callback, gtk_container_add(GTK_CONTAINER(scroll_window), history_tree_); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(history_tree_), TRUE); - g_signal_connect(G_OBJECT(history_tree_), "row-activated", + g_signal_connect(history_tree_, "row-activated", G_CALLBACK(OnHistoryRowActivated), this); history_selection_ = gtk_tree_view_get_selection( GTK_TREE_VIEW(history_tree_)); gtk_tree_selection_set_mode(history_selection_, GTK_SELECTION_SINGLE); - g_signal_connect(G_OBJECT(history_selection_), "changed", + g_signal_connect(history_selection_, "changed", G_CALLBACK(OnHistorySelectionChanged), this); // History list columns. diff --git a/chrome/browser/gtk/process_singleton_dialog.cc b/chrome/browser/gtk/process_singleton_dialog.cc index ffaf503..3710e0b 100644 --- a/chrome/browser/gtk/process_singleton_dialog.cc +++ b/chrome/browser/gtk/process_singleton_dialog.cc @@ -28,8 +28,7 @@ ProcessSingletonDialog::ProcessSingletonDialog(const std::string& message) { gtk_dialog_add_button(GTK_DIALOG(dialog_), GTK_STOCK_QUIT, GTK_RESPONSE_REJECT); - g_signal_connect(G_OBJECT(dialog_), "response", - G_CALLBACK(OnResponse), this); + g_signal_connect(dialog_, "response", G_CALLBACK(OnResponse), this); gtk_widget_show_all(dialog_); MessageLoop::current()->Run(); diff --git a/chrome/browser/gtk/rounded_window.cc b/chrome/browser/gtk/rounded_window.cc index cb25bd7..c512a0e 100644 --- a/chrome/browser/gtk/rounded_window.cc +++ b/chrome/browser/gtk/rounded_window.cc @@ -256,9 +256,9 @@ void ActAsRoundedWindow( DCHECK(!g_object_get_data(G_OBJECT(widget), kRoundedData)); gtk_widget_set_app_paintable(widget, TRUE); - g_signal_connect(G_OBJECT(widget), "expose-event", + g_signal_connect(widget, "expose-event", G_CALLBACK(OnRoundedWindowExpose), NULL); - g_signal_connect(G_OBJECT(widget), "style-set", G_CALLBACK(OnStyleSet), NULL); + g_signal_connect(widget, "style-set", G_CALLBACK(OnStyleSet), NULL); RoundedWindowData* data = new RoundedWindowData; data->expected_width = -1; diff --git a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc index 6cbae72..56a83bf 100644 --- a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc +++ b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc @@ -60,7 +60,7 @@ DraggedTabGtk::DraggedTabGtk(TabContents* datasource, container_ = gtk_window_new(GTK_WINDOW_POPUP); SetContainerColorMap(); gtk_widget_set_app_paintable(container_, TRUE); - g_signal_connect(G_OBJECT(container_), "expose-event", + g_signal_connect(container_, "expose-event", G_CALLBACK(OnExposeEvent), this); gtk_widget_add_events(container_, GDK_STRUCTURE_MASK); diff --git a/chrome/browser/gtk/tabs/tab_gtk.cc b/chrome/browser/gtk/tabs/tab_gtk.cc index abb05e0..46fecc2 100644 --- a/chrome/browser/gtk/tabs/tab_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_gtk.cc @@ -147,13 +147,13 @@ TabGtk::TabGtk(TabDelegate* delegate) ALLOW_THIS_IN_INITIALIZER_LIST(drag_end_factory_(this)) { event_box_ = gtk_event_box_new(); gtk_event_box_set_visible_window(GTK_EVENT_BOX(event_box_), FALSE); - g_signal_connect(G_OBJECT(event_box_), "button-press-event", + g_signal_connect(event_box_, "button-press-event", G_CALLBACK(OnButtonPressEvent), this); - g_signal_connect(G_OBJECT(event_box_), "button-release-event", + g_signal_connect(event_box_, "button-release-event", G_CALLBACK(OnButtonReleaseEvent), this); - g_signal_connect(G_OBJECT(event_box_), "enter-notify-event", + g_signal_connect(event_box_, "enter-notify-event", G_CALLBACK(OnEnterNotifyEvent), this); - g_signal_connect(G_OBJECT(event_box_), "leave-notify-event", + g_signal_connect(event_box_, "leave-notify-event", G_CALLBACK(OnLeaveNotifyEvent), this); gtk_widget_add_events(event_box_, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc index b015468..0f44eaf 100644 --- a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc @@ -253,9 +253,9 @@ TabRendererGtk::TabRendererGtk(ThemeProvider* theme_provider) tab_.Own(gtk_fixed_new()); gtk_widget_set_app_paintable(tab_.get(), TRUE); - g_signal_connect(G_OBJECT(tab_.get()), "expose-event", + g_signal_connect(tab_.get(), "expose-event", G_CALLBACK(OnExposeEvent), this); - g_signal_connect(G_OBJECT(tab_.get()), "size-allocate", + g_signal_connect(tab_.get(), "size-allocate", G_CALLBACK(OnSizeAllocate), this); close_button_.reset(MakeCloseButton()); gtk_widget_show(tab_.get()); @@ -961,13 +961,13 @@ CustomDrawButton* TabRendererGtk::MakeCloseButton() { CustomDrawButton* button = new CustomDrawButton(IDR_TAB_CLOSE, IDR_TAB_CLOSE_P, IDR_TAB_CLOSE_H, IDR_TAB_CLOSE); - g_signal_connect(G_OBJECT(button->widget()), "clicked", + g_signal_connect(button->widget(), "clicked", G_CALLBACK(OnCloseButtonClicked), this); - g_signal_connect(G_OBJECT(button->widget()), "button-release-event", + g_signal_connect(button->widget(), "button-release-event", G_CALLBACK(OnCloseButtonMouseRelease), this); - g_signal_connect(G_OBJECT(button->widget()), "enter-notify-event", + g_signal_connect(button->widget(), "enter-notify-event", G_CALLBACK(OnEnterNotifyEvent), this); - g_signal_connect(G_OBJECT(button->widget()), "leave-notify-event", + g_signal_connect(button->widget(), "leave-notify-event", G_CALLBACK(OnLeaveNotifyEvent), this); GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); gtk_fixed_put(GTK_FIXED(tab_.get()), button->widget(), 0, 0); diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc index 8302119..cb63413 100644 --- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc @@ -562,17 +562,17 @@ void TabStripGtk::Init() { -1 }; GtkDndUtil::SetDestTargetList(tabstrip_.get(), targets); - g_signal_connect(G_OBJECT(tabstrip_.get()), "expose-event", + g_signal_connect(tabstrip_.get(), "expose-event", G_CALLBACK(OnExpose), this); - g_signal_connect(G_OBJECT(tabstrip_.get()), "size-allocate", - G_CALLBACK(OnSizeAllocate), this); - g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-motion", + g_signal_connect(tabstrip_.get(), "size-allocate", + G_CALLBACK(OnSizeAllocate), this); + g_signal_connect(tabstrip_.get(), "drag-motion", G_CALLBACK(OnDragMotion), this); - g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-drop", + g_signal_connect(tabstrip_.get(), "drag-drop", G_CALLBACK(OnDragDrop), this); - g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-leave", + g_signal_connect(tabstrip_.get(), "drag-leave", G_CALLBACK(OnDragLeave), this); - g_signal_connect(G_OBJECT(tabstrip_.get()), "drag-data-received", + g_signal_connect(tabstrip_.get(), "drag-data-received", G_CALLBACK(OnDragDataReceived), this); newtab_button_.reset(MakeNewTabButton()); @@ -1526,7 +1526,7 @@ void TabStripGtk::DropInfo::CreateContainer() { container = gtk_window_new(GTK_WINDOW_POPUP); SetContainerColorMap(); gtk_widget_set_app_paintable(container, TRUE); - g_signal_connect(G_OBJECT(container), "expose-event", + g_signal_connect(container, "expose-event", G_CALLBACK(OnExposeEvent), this); gtk_widget_add_events(container, GDK_STRUCTURE_MASK); gtk_window_move(GTK_WINDOW(container), 0, 0); @@ -1853,7 +1853,7 @@ CustomDrawButton* TabStripGtk::MakeNewTabButton() { // Let the middle mouse button initiate clicks as well. gtk_util::SetButtonTriggersNavigation(button->widget()); - g_signal_connect(G_OBJECT(button->widget()), "clicked", + g_signal_connect(button->widget(), "clicked", G_CALLBACK(OnNewTabClicked), this); GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); diff --git a/chrome/browser/gtk/task_manager_gtk.cc b/chrome/browser/gtk/task_manager_gtk.cc index 8f6431a..a50ab75 100644 --- a/chrome/browser/gtk/task_manager_gtk.cc +++ b/chrome/browser/gtk/task_manager_gtk.cc @@ -391,10 +391,10 @@ void TaskManagerGtk::Init() { gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), gtk_util::kContentAreaSpacing); - destroy_handler_id_ = g_signal_connect(G_OBJECT(dialog_), "destroy", + destroy_handler_id_ = g_signal_connect(dialog_, "destroy", G_CALLBACK(OnDestroy), this); - g_signal_connect(G_OBJECT(dialog_), "response", G_CALLBACK(OnResponse), this); - g_signal_connect(G_OBJECT(dialog_), "button-release-event", + g_signal_connect(dialog_, "response", G_CALLBACK(OnResponse), this); + g_signal_connect(dialog_, "button-release-event", G_CALLBACK(OnButtonReleaseEvent), this); gtk_widget_add_events(dialog_, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); @@ -410,7 +410,7 @@ void TaskManagerGtk::Init() { CreateTaskManagerTreeview(); gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(treeview_), TRUE); - g_signal_connect(G_OBJECT(treeview_), "button-press-event", + g_signal_connect(treeview_, "button-press-event", G_CALLBACK(OnButtonPressEvent), this); gtk_widget_add_events(treeview_, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); @@ -419,7 +419,7 @@ void TaskManagerGtk::Init() { GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(treeview_)); gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE); - g_signal_connect(G_OBJECT(selection), "changed", + g_signal_connect(selection, "changed", G_CALLBACK(OnSelectionChanged), this); gtk_container_add(GTK_CONTAINER(scrolled), treeview_); @@ -433,7 +433,7 @@ void TaskManagerGtk::Init() { void TaskManagerGtk::SetInitialDialogSize() { // Hook up to the realize event so we can size the page column to the // size of the leftover space after packing the other columns. - g_signal_connect(G_OBJECT(treeview_), "realize", + g_signal_connect(treeview_, "realize", G_CALLBACK(OnTreeViewRealize), this); // If we previously saved the dialog's bounds, use them. if (g_browser_process->local_state()) { diff --git a/chrome/browser/input_window_dialog_gtk.cc b/chrome/browser/input_window_dialog_gtk.cc index b6bf5dc..c3f7b04 100644 --- a/chrome/browser/input_window_dialog_gtk.cc +++ b/chrome/browser/input_window_dialog_gtk.cc @@ -72,7 +72,7 @@ GtkInputWindowDialog::GtkInputWindowDialog(GtkWindow* parent, input_ = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(input_), contents.c_str()); - g_signal_connect(G_OBJECT(input_), "changed", + g_signal_connect(input_, "changed", G_CALLBACK(OnEntryChanged), this); g_object_set(G_OBJECT(input_), "activates-default", TRUE, NULL); gtk_box_pack_start(GTK_BOX(hbox), input_, TRUE, TRUE, 0); diff --git a/chrome/common/gtk_util.cc b/chrome/common/gtk_util.cc index 907f9b9..c175330 100644 --- a/chrome/common/gtk_util.cc +++ b/chrome/common/gtk_util.cc @@ -384,9 +384,9 @@ void SetButtonClickableByMouseButtons(GtkWidget* button, button_mask |= 1 << 3; void* userdata = GINT_TO_POINTER(button_mask); - g_signal_connect(G_OBJECT(button), "button-press-event", + g_signal_connect(button, "button-press-event", G_CALLBACK(OnMouseButtonPressed), userdata); - g_signal_connect(G_OBJECT(button), "button-release-event", + g_signal_connect(button, "button-release-event", G_CALLBACK(OnMouseButtonReleased), userdata); } -- cgit v1.1