diff options
author | mdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-31 00:40:15 +0000 |
---|---|---|
committer | mdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-31 00:40:15 +0000 |
commit | 1b2fca9f6e4d36fc2aa72eb2c3409f3de3175273 (patch) | |
tree | 0453433e11a19bdc984a3aa17a641ebab2be1301 /chrome | |
parent | 48f2336c6595318dd8f07f1e54a60091607382dc (diff) | |
download | chromium_src-1b2fca9f6e4d36fc2aa72eb2c3409f3de3175273.zip chromium_src-1b2fca9f6e4d36fc2aa72eb2c3409f3de3175273.tar.gz chromium_src-1b2fca9f6e4d36fc2aa72eb2c3409f3de3175273.tar.bz2 |
Linux: convert classes GtkUtil/GtkTreeUtil back to namespaces gtk_util/gtk_tree_util.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/160417
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22130 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
56 files changed, 346 insertions, 355 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc index 0387871..8c5dbf9 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc @@ -133,7 +133,7 @@ void AutocompleteEditViewGtk::Init() { const double kFontSize = 13.4; // 13.4px == 10pt @ 96dpi // On Windows, popups have a font size 5/6 the size of non-popups. const double kPopupWindowFontSize = kFontSize * 5.0 / 6.0; - GtkUtil::ForceFontSizePixels(text_view_, + gtk_util::ForceFontSizePixels(text_view_, popup_window_mode_ ? kPopupWindowFontSize : kFontSize); } @@ -594,7 +594,7 @@ void AutocompleteEditViewGtk::HandlePopulatePopup(GtkMenu* menu) { // Search Engine menu item. GtkWidget* search_engine_menuitem = gtk_menu_item_new_with_mnemonic( - GtkUtil::ConvertAcceleratorsFromWindowsStyle( + gtk_util::ConvertAcceleratorsFromWindowsStyle( l10n_util::GetStringUTF8(IDS_EDIT_SEARCH_ENGINES)).c_str()); gtk_menu_shell_append(GTK_MENU_SHELL(menu), search_engine_menuitem); g_signal_connect(search_engine_menuitem, "activate", @@ -603,7 +603,7 @@ void AutocompleteEditViewGtk::HandlePopulatePopup(GtkMenu* menu) { // Paste and Go menu item. GtkWidget* paste_go_menuitem = gtk_menu_item_new_with_mnemonic( - GtkUtil::ConvertAcceleratorsFromWindowsStyle( + gtk_util::ConvertAcceleratorsFromWindowsStyle( l10n_util::GetStringUTF8(model_->is_paste_and_search() ? IDS_PASTE_AND_SEARCH : IDS_PASTE_AND_GO)).c_str()); gtk_menu_shell_append(GTK_MENU_SHELL(menu), paste_go_menuitem); diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index ff550f4..302385d 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -381,7 +381,7 @@ int BrowserMain(const MainFunctionParams& parameters) { #if defined(TOOLKIT_GTK) // It is important for this to happen before the first run dialog, as it // styles the dialog as well. - GtkUtil::InitRCStyles(); + gtk_util::InitRCStyles(); #elif defined(TOOLKIT_VIEWS) // The delegate needs to be set before any UI is created so that windows // display the correct icon. diff --git a/chrome/browser/dock_info_gtk.cc b/chrome/browser/dock_info_gtk.cc index 49db540..403b65d 100644 --- a/chrome/browser/dock_info_gtk.cc +++ b/chrome/browser/dock_info_gtk.cc @@ -100,7 +100,7 @@ class TopMostFinder : public BaseWindowFinder { target_(window), screen_loc_(screen_loc), is_top_most_(false) { - GtkUtil::EnumerateTopLevelWindows(this); + gtk_util::EnumerateTopLevelWindows(this); } // The window we're looking for. @@ -163,7 +163,7 @@ class LocalProcessWindowFinder : public BaseWindowFinder { : BaseWindowFinder(ignore), screen_loc_(screen_loc), result_(0) { - GtkUtil::EnumerateTopLevelWindows(this); + gtk_util::EnumerateTopLevelWindows(this); } // Position of the mouse. diff --git a/chrome/browser/gtk/about_chrome_dialog.cc b/chrome/browser/gtk/about_chrome_dialog.cc index 2043d7e..e0aa1ab 100644 --- a/chrome/browser/gtk/about_chrome_dialog.cc +++ b/chrome/browser/gtk/about_chrome_dialog.cc @@ -106,7 +106,7 @@ void ShowAboutDialogForProfile(GtkWindow* parent, Profile* profile) { GTK_DIALOG_MODAL, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); - // Pick up the style set in GtkUtil::InitRCStyles(). + // Pick up the style set in gtk_util.cc:InitRCStyles(). // The layout of this dialog is special because the logo should be flush // with the edges of the window. gtk_widget_set_name(dialog, "about-dialog"); @@ -154,9 +154,9 @@ void ShowAboutDialogForProfile(GtkWindow* parent, Profile* profile) { // We use a separate box for the licensing etc. text. See the comment near // the top of this function about using a special layout for this dialog. - GtkWidget* vbox = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_container_set_border_width(GTK_CONTAINER(vbox), - GtkUtil::kContentAreaBorder); + gtk_util::kContentAreaBorder); GtkWidget* copyright_label = MakeMarkupLabel( kSmaller, l10n_util::GetStringUTF8(IDS_ABOUT_VERSION_COPYRIGHT)); diff --git a/chrome/browser/gtk/back_forward_button_gtk.cc b/chrome/browser/gtk/back_forward_button_gtk.cc index bd09dbe..009be74 100644 --- a/chrome/browser/gtk/back_forward_button_gtk.cc +++ b/chrome/browser/gtk/back_forward_button_gtk.cc @@ -70,7 +70,7 @@ BackForwardButtonGtk::BackForwardButtonGtk(Browser* browser, bool is_forward) g_object_set_data(G_OBJECT(widget()), "left-align-popup", reinterpret_cast<void*>(true)); - GtkUtil::SetButtonTriggersNavigation(widget()); + gtk_util::SetButtonTriggersNavigation(widget()); } BackForwardButtonGtk::~BackForwardButtonGtk() { diff --git a/chrome/browser/gtk/blocked_popup_container_view_gtk.cc b/chrome/browser/gtk/blocked_popup_container_view_gtk.cc index cfb55e5..8ada0f0 100644 --- a/chrome/browser/gtk/blocked_popup_container_view_gtk.cc +++ b/chrome/browser/gtk/blocked_popup_container_view_gtk.cc @@ -173,11 +173,11 @@ void BlockedPopupContainerViewGtk::Init() { GtkWidget* hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), menu_button_, FALSE, FALSE, kSmallPadding); - GtkUtil::CenterWidgetInHBox(hbox, close_button_->widget(), true, 0); + gtk_util::CenterWidgetInHBox(hbox, close_button_->widget(), true, 0); g_signal_connect(close_button_->widget(), "clicked", G_CALLBACK(OnCloseButtonClicked), this); - container_.Own(GtkUtil::CreateGtkBorderBin(hbox, NULL, + container_.Own(gtk_util::CreateGtkBorderBin(hbox, NULL, kSmallPadding, kSmallPadding, kSmallPadding, kSmallPadding)); // Manually paint the event box. gtk_widget_set_app_paintable(container_.get(), TRUE); diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc index 2278f59..5e2c736 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.cc +++ b/chrome/browser/gtk/bookmark_bar_gtk.cc @@ -356,7 +356,7 @@ void BookmarkBarGtk::SetInstructionState() { } void BookmarkBarGtk::RemoveAllBookmarkButtons() { - GtkUtil::RemoveAllChildren(bookmark_toolbar_.get()); + gtk_util::RemoveAllChildren(bookmark_toolbar_.get()); } int BookmarkBarGtk::GetBookmarkButtonCount() { diff --git a/chrome/browser/gtk/bookmark_bubble_gtk.cc b/chrome/browser/gtk/bookmark_bubble_gtk.cc index 28c3ebd..67c9dc6 100644 --- a/chrome/browser/gtk/bookmark_bubble_gtk.cc +++ b/chrome/browser/gtk/bookmark_bubble_gtk.cc @@ -185,7 +185,7 @@ BookmarkBubbleGtk::BookmarkBubbleGtk(GtkWindow* transient_toplevel, // We use a table to allow the labels to line up with each other, along // with the entry and folder combo lining up. - GtkWidget* table = GtkUtil::CreateLabeledControlsGroup( + GtkWidget* table = gtk_util::CreateLabeledControlsGroup( &labels_, l10n_util::GetStringUTF8(IDS_BOOMARK_BUBBLE_TITLE_TEXT).c_str(), name_entry_, diff --git a/chrome/browser/gtk/bookmark_editor_gtk.cc b/chrome/browser/gtk/bookmark_editor_gtk.cc index 07a9ac9..8b449a4 100644 --- a/chrome/browser/gtk/bookmark_editor_gtk.cc +++ b/chrome/browser/gtk/bookmark_editor_gtk.cc @@ -124,7 +124,7 @@ void BookmarkEditorGtk::Init(GtkWindow* parent_window) { // |+-------------------------------------------------------------+| // +---------------------------------------------------------------+ GtkWidget* content_area = GTK_DIALOG(dialog_)->vbox; - gtk_box_set_spacing(GTK_BOX(content_area), GtkUtil::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); GtkWidget* vbox = gtk_vbox_new(FALSE, 12); @@ -142,7 +142,7 @@ void BookmarkEditorGtk::Init(GtkWindow* parent_window) { G_CALLBACK(OnEntryChanged), this); gtk_entry_set_activates_default(GTK_ENTRY(url_entry_), TRUE); - GtkWidget* table = GtkUtil::CreateLabeledControlsGroup(NULL, + GtkWidget* table = gtk_util::CreateLabeledControlsGroup(NULL, l10n_util::GetStringUTF8(IDS_BOOMARK_EDITOR_NAME_LABEL).c_str(), name_entry_, l10n_util::GetStringUTF8(IDS_BOOMARK_EDITOR_URL_LABEL).c_str(), diff --git a/chrome/browser/gtk/bookmark_manager_gtk.cc b/chrome/browser/gtk/bookmark_manager_gtk.cc index 132b6f9..2092367 100644 --- a/chrome/browser/gtk/bookmark_manager_gtk.cc +++ b/chrome/browser/gtk/bookmark_manager_gtk.cc @@ -321,7 +321,7 @@ BookmarkManagerGtk::BookmarkManagerGtk(Profile* profile) sending_delayed_mousedown_(false), ignore_rightclicks_(false) { InitWidgets(); - GtkUtil::SetWindowIcon(GTK_WINDOW(window_)); + gtk_util::SetWindowIcon(GTK_WINDOW(window_)); model_->AddObserver(this); if (model_->IsLoaded()) @@ -367,13 +367,13 @@ void BookmarkManagerGtk::InitWidgets() { l10n_util::GetStringUTF8(IDS_BOOKMARK_MANAGER_ORGANIZE_MENU).c_str()); GtkWidget* import_item = gtk_menu_item_new_with_mnemonic( - GtkUtil::ConvertAcceleratorsFromWindowsStyle( + gtk_util::ConvertAcceleratorsFromWindowsStyle( l10n_util::GetStringUTF8(IDS_BOOKMARK_MANAGER_IMPORT_MENU)).c_str()); g_signal_connect(import_item, "activate", G_CALLBACK(OnImportItemActivated), this); GtkWidget* export_item = gtk_menu_item_new_with_mnemonic( - GtkUtil::ConvertAcceleratorsFromWindowsStyle( + gtk_util::ConvertAcceleratorsFromWindowsStyle( l10n_util::GetStringUTF8(IDS_BOOKMARK_MANAGER_EXPORT_MENU)).c_str()); g_signal_connect(export_item, "activate", G_CALLBACK(OnExportItemActivated), this); @@ -584,7 +584,7 @@ void BookmarkManagerGtk::SetInitialWindowSize() { // Otherwise, just set a default size (GTK will override this if it's not // large enough to hold the window's contents). int width = 1, height = 1; - GtkUtil::GetWidgetSizeFromResources( + gtk_util::GetWidgetSizeFromResources( window_, IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS, IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES, diff --git a/chrome/browser/gtk/browser_toolbar_gtk.cc b/chrome/browser/gtk/browser_toolbar_gtk.cc index 4993832..f10d605 100644 --- a/chrome/browser/gtk/browser_toolbar_gtk.cc +++ b/chrome/browser/gtk/browser_toolbar_gtk.cc @@ -182,7 +182,7 @@ void BrowserToolbarGtk::Init(Profile* profile, home_.reset(BuildToolbarButton(IDR_HOME, IDR_HOME_P, IDR_HOME_H, 0, l10n_util::GetStringUTF8(IDS_TOOLTIP_HOME), GTK_STOCK_HOME)); - GtkUtil::SetButtonTriggersNavigation(home_->widget()); + gtk_util::SetButtonTriggersNavigation(home_->widget()); SetUpDragForHomeButton(); // Group the start, omnibox, and go button into an hbox. @@ -672,9 +672,9 @@ void BrowserToolbarGtk::OnDragDataReceived(GtkWidget* widget, // static gboolean BrowserToolbarGtk::OnPageAppMenuMouseMotion(GtkWidget* menu, GdkEventMotion* event, BrowserToolbarGtk* toolbar) { - if (GtkUtil::WidgetContainsCursor(menu == toolbar->app_menu_->widget() ? - toolbar->page_menu_button_.get() : - toolbar->app_menu_button_.get())) { + if (gtk_util::WidgetContainsCursor(menu == toolbar->app_menu_->widget() ? + toolbar->page_menu_button_.get() : + toolbar->app_menu_button_.get())) { toolbar->ChangeActiveMenu(menu, event->time); return TRUE; } diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 2885947..ff0373c 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -401,7 +401,7 @@ BrowserWindowGtk::BrowserWindowGtk(Browser* browser) gtk_window_group_add_window(gtk_window_group_new(), window_); g_object_unref(gtk_window_get_group(window_)); - GtkUtil::SetWindowIcon(window_); + gtk_util::SetWindowIcon(window_); SetBackgroundColor(); SetGeometryHints(); ConnectHandlersToSignals(); diff --git a/chrome/browser/gtk/clear_browsing_data_dialog_gtk.cc b/chrome/browser/gtk/clear_browsing_data_dialog_gtk.cc index 18188cd..4d0451c 100644 --- a/chrome/browser/gtk/clear_browsing_data_dialog_gtk.cc +++ b/chrome/browser/gtk/clear_browsing_data_dialog_gtk.cc @@ -33,9 +33,9 @@ ClearBrowsingDataDialogGtk::ClearBrowsingDataDialogGtk(GtkWindow* parent, NULL); GtkWidget* content_area = GTK_DIALOG(dialog)->vbox; - gtk_box_set_spacing(GTK_BOX(content_area), GtkUtil::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); - GtkWidget* vbox = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_container_add(GTK_CONTAINER(content_area), vbox); // Label on top of the checkboxes. @@ -99,7 +99,7 @@ ClearBrowsingDataDialogGtk::ClearBrowsingDataDialogGtk(GtkWindow* parent, G_CALLBACK(HandleOnClickedWidget), this); // Create a horizontal layout for the combo box and label. - GtkWidget* combo_hbox = gtk_hbox_new(FALSE, GtkUtil::kLabelSpacing); + GtkWidget* combo_hbox = gtk_hbox_new(FALSE, gtk_util::kLabelSpacing); GtkWidget* time_period_label_ = gtk_label_new( l10n_util::GetStringUTF8(IDS_CLEAR_BROWSING_DATA_TIME_LABEL).c_str()); gtk_box_pack_start(GTK_BOX(combo_hbox), time_period_label_, FALSE, FALSE, 0); diff --git a/chrome/browser/gtk/constrained_window_gtk.cc b/chrome/browser/gtk/constrained_window_gtk.cc index 2d9e164..1f53a59 100644 --- a/chrome/browser/gtk/constrained_window_gtk.cc +++ b/chrome/browser/gtk/constrained_window_gtk.cc @@ -23,8 +23,8 @@ ConstrainedWindowGtk::ConstrainedWindowGtk( gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT); GtkWidget* alignment = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), - GtkUtil::kContentAreaBorder, GtkUtil::kContentAreaBorder, - GtkUtil::kContentAreaBorder, GtkUtil::kContentAreaBorder); + gtk_util::kContentAreaBorder, gtk_util::kContentAreaBorder, + gtk_util::kContentAreaBorder, gtk_util::kContentAreaBorder); gtk_container_add(GTK_CONTAINER(alignment), dialog); gtk_container_add(GTK_CONTAINER(frame), alignment); gtk_container_add(GTK_CONTAINER(ebox), frame); diff --git a/chrome/browser/gtk/custom_button.cc b/chrome/browser/gtk/custom_button.cc index afd08e7..f27e01b 100644 --- a/chrome/browser/gtk/custom_button.cc +++ b/chrome/browser/gtk/custom_button.cc @@ -72,7 +72,7 @@ gboolean CustomDrawButtonBase::OnExpose(GtkWidget* widget, GdkEventExpose* e) { // The widget might be larger than the pixbuf. Paint the pixbuf flush with the // start of the widget (left for LTR, right for RTL). gfx::Rect bounds = gfx::Rect(0, 0, gdk_pixbuf_get_width(pixbuf), 0); - int x = GtkUtil::MirroredLeftPointForRect(widget, bounds); + int x = gtk_util::MirroredLeftPointForRect(widget, bounds); if (background_image_) { gdk_cairo_set_source_pixbuf(cairo_context, background_image_, x, 0); diff --git a/chrome/browser/gtk/download_item_gtk.cc b/chrome/browser/gtk/download_item_gtk.cc index ece9424..78a0b46 100644 --- a/chrome/browser/gtk/download_item_gtk.cc +++ b/chrome/browser/gtk/download_item_gtk.cc @@ -211,8 +211,8 @@ DownloadItemGtk::DownloadItemGtk(DownloadShelfGtk* parent_shelf, gtk_misc_set_alignment(GTK_MISC(name_label_), 0, 0.5); gtk_misc_set_alignment(GTK_MISC(status_label_), 0, 0.5); // Until we switch to vector graphics, force the font size. - GtkUtil::ForceFontSizePixels(name_label_, 13.4); // 13.4px == 10pt @ 96dpi - GtkUtil::ForceFontSizePixels(status_label_, 13.4); // 13.4px == 10pt @ 96dpi + gtk_util::ForceFontSizePixels(name_label_, 13.4); // 13.4px == 10pt @ 96dpi + gtk_util::ForceFontSizePixels(status_label_, 13.4); // 13.4px == 10pt @ 96dpi // Stack the labels on top of one another. GtkWidget* text_stack = gtk_vbox_new(FALSE, 0); @@ -298,7 +298,7 @@ DownloadItemGtk::DownloadItemGtk(DownloadShelfGtk* parent_shelf, GtkWidget* dangerous_label = gtk_label_new(NULL); // Until we switch to vector graphics, force the font size. // 13.4px == 10pt @ 96dpi - GtkUtil::ForceFontSizePixels(dangerous_label, 13.4); + gtk_util::ForceFontSizePixels(dangerous_label, 13.4); gtk_label_set_markup(GTK_LABEL(dangerous_label), label_markup); gtk_label_set_line_wrap(GTK_LABEL(dangerous_label), TRUE); // We pass TRUE, TRUE so that the label will condense to less than its @@ -313,14 +313,14 @@ DownloadItemGtk::DownloadItemGtk(DownloadShelfGtk* parent_shelf, l10n_util::GetStringUTF8(IDS_SAVE_DOWNLOAD).c_str()); g_signal_connect(dangerous_accept, "clicked", G_CALLBACK(OnDangerousAccept), this); - GtkUtil::CenterWidgetInHBox(dangerous_hbox_, dangerous_accept, false, 0); + gtk_util::CenterWidgetInHBox(dangerous_hbox_, dangerous_accept, false, 0); // Create the nevermind button. GtkWidget* dangerous_decline = gtk_button_new_with_label( l10n_util::GetStringUTF8(IDS_DISCARD_DOWNLOAD).c_str()); g_signal_connect(dangerous_decline, "clicked", G_CALLBACK(OnDangerousDecline), this); - GtkUtil::CenterWidgetInHBox(dangerous_hbox_, dangerous_decline, false, 0); + gtk_util::CenterWidgetInHBox(dangerous_hbox_, dangerous_decline, false, 0); // Put it in an alignment so that padding will be added on the left and // right. diff --git a/chrome/browser/gtk/download_request_dialog_delegate_gtk.cc b/chrome/browser/gtk/download_request_dialog_delegate_gtk.cc index 921684c..8903ee2 100644 --- a/chrome/browser/gtk/download_request_dialog_delegate_gtk.cc +++ b/chrome/browser/gtk/download_request_dialog_delegate_gtk.cc @@ -29,7 +29,7 @@ DownloadRequestDialogDelegateGtk::DownloadRequestDialogDelegateGtk( : DownloadRequestDialogDelegate(host), responded_(false) { // Create dialog. - root_.Own(gtk_vbox_new(NULL, GtkUtil::kContentAreaBorder)); + root_.Own(gtk_vbox_new(NULL, gtk_util::kContentAreaBorder)); GtkWidget* label = gtk_label_new( l10n_util::GetStringUTF8(IDS_MULTI_DOWNLOAD_WARNING).c_str()); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); diff --git a/chrome/browser/gtk/download_shelf_gtk.cc b/chrome/browser/gtk/download_shelf_gtk.cc index 5295f34..8d83f84 100644 --- a/chrome/browser/gtk/download_shelf_gtk.cc +++ b/chrome/browser/gtk/download_shelf_gtk.cc @@ -89,7 +89,7 @@ DownloadShelfGtk::DownloadShelfGtk(Browser* browser, GtkWidget* parent) // Create and pack the close button. close_button_.reset(CustomDrawButton::CloseButton(theme_provider_)); - GtkUtil::CenterWidgetInHBox(hbox_.get(), close_button_->widget(), true, 0); + gtk_util::CenterWidgetInHBox(hbox_.get(), close_button_->widget(), true, 0); g_signal_connect(close_button_->widget(), "clicked", G_CALLBACK(OnButtonClick), this); @@ -101,8 +101,8 @@ DownloadShelfGtk::DownloadShelfGtk(Browser* browser, GtkWidget* parent) G_CALLBACK(OnButtonClick), this); // Until we switch to vector graphics, force the font size. // 13.4px == 10pt @ 96dpi - GtkUtil::ForceFontSizePixels(GTK_CHROME_LINK_BUTTON(link_button)->label, - 13.4); + gtk_util::ForceFontSizePixels(GTK_CHROME_LINK_BUTTON(link_button)->label, + 13.4); // Make the download arrow icon. ResourceBundle& rb = ResourceBundle::GetSharedInstance(); @@ -111,8 +111,8 @@ DownloadShelfGtk::DownloadShelfGtk(Browser* browser, GtkWidget* parent) // Pack the link and the icon in an hbox. link_hbox_ = gtk_hbox_new(FALSE, 5); - GtkUtil::CenterWidgetInHBox(link_hbox_, download_image, false, 0); - GtkUtil::CenterWidgetInHBox(link_hbox_, link_button, false, 0); + gtk_util::CenterWidgetInHBox(link_hbox_, download_image, false, 0); + gtk_util::CenterWidgetInHBox(link_hbox_, link_button, false, 0); gtk_box_pack_end(GTK_BOX(hbox_.get()), link_hbox_, FALSE, FALSE, 0); slide_widget_.reset(new SlideAnimatorGtk(shelf_.get(), diff --git a/chrome/browser/gtk/edit_search_engine_dialog.cc b/chrome/browser/gtk/edit_search_engine_dialog.cc index 6752623..509d538 100644 --- a/chrome/browser/gtk/edit_search_engine_dialog.cc +++ b/chrome/browser/gtk/edit_search_engine_dialog.cc @@ -27,7 +27,7 @@ std::string GetDisplayURL(const TemplateURL& turl) { } GtkWidget* CreateEntryImageHBox(GtkWidget* entry, GtkWidget* image) { - GtkWidget* hbox = gtk_hbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); return hbox; @@ -139,7 +139,7 @@ void EditSearchEngineDialog::Init(GtkWindow* parent_window) { controller_->template_url()->prepopulate_id() == 0); } - GtkWidget* controls = GtkUtil::CreateLabeledControlsGroup(NULL, + GtkWidget* controls = gtk_util::CreateLabeledControlsGroup(NULL, l10n_util::GetStringUTF8( IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_LABEL).c_str(), CreateEntryImageHBox(title_entry_, title_image_), @@ -177,7 +177,7 @@ void EditSearchEngineDialog::Init(GtkWindow* parent_window) { FALSE, FALSE, 0); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), - GtkUtil::kContentAreaSpacing); + gtk_util::kContentAreaSpacing); EnableControls(); diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc index ab068c5..526a002 100644 --- a/chrome/browser/gtk/find_bar_gtk.cc +++ b/chrome/browser/gtk/find_bar_gtk.cc @@ -136,7 +136,7 @@ void FindBarGtk::InitWidgets() { // lateral position. We put that fixed in a SlideAnimatorGtk in order to get // the slide effect. GtkWidget* hbox = gtk_hbox_new(false, 0); - container_ = GtkUtil::CreateGtkBorderBin(hbox, NULL, + container_ = gtk_util::CreateGtkBorderBin(hbox, NULL, kBarPaddingTopBottom, kBarPaddingTopBottom, kEntryPaddingLeft, kBarPaddingRight); gtk_widget_set_app_paintable(container_, TRUE); @@ -157,8 +157,8 @@ void FindBarGtk::InitWidgets() { gtk_widget_set_size_request(widget(), -1, 0); close_button_.reset(CustomDrawButton::CloseButton(NULL)); - GtkUtil::CenterWidgetInHBox(hbox, close_button_->widget(), true, - kCloseButtonPaddingLeft); + gtk_util::CenterWidgetInHBox(hbox, close_button_->widget(), true, + kCloseButtonPaddingLeft); g_signal_connect(G_OBJECT(close_button_->widget()), "clicked", G_CALLBACK(OnClicked), this); gtk_widget_set_tooltip_text(close_button_->widget(), @@ -209,8 +209,8 @@ void FindBarGtk::InitWidgets() { gtk_entry_set_has_frame(GTK_ENTRY(text_entry_), FALSE); // Until we switch to vector graphics, force the font size. - GtkUtil::ForceFontSizePixels(text_entry_, 13.4); // 13.4px == 10pt @ 96dpi - GtkUtil::ForceFontSizePixels(match_count_centerer, 13.4); + gtk_util::ForceFontSizePixels(text_entry_, 13.4); // 13.4px == 10pt @ 96dpi + gtk_util::ForceFontSizePixels(match_count_centerer, 13.4); gtk_box_pack_end(GTK_BOX(content_hbox), match_count_centerer, FALSE, FALSE, 0); @@ -227,13 +227,13 @@ void FindBarGtk::InitWidgets() { gtk_container_add(GTK_CONTAINER(content_event_box), content_hbox); // We fake anti-aliasing by having two borders. - GtkWidget* border_bin = GtkUtil::CreateGtkBorderBin(content_event_box, - &kTextBorderColor, - 1, 1, 1, 0); - GtkWidget* border_bin_aa = GtkUtil::CreateGtkBorderBin(border_bin, - &kTextBorderColorAA, - 1, 1, 1, 0); - GtkUtil::CenterWidgetInHBox(hbox, border_bin_aa, true, 0); + GtkWidget* border_bin = gtk_util::CreateGtkBorderBin(content_event_box, + &kTextBorderColor, + 1, 1, 1, 0); + GtkWidget* border_bin_aa = gtk_util::CreateGtkBorderBin(border_bin, + &kTextBorderColorAA, + 1, 1, 1, 0); + gtk_util::CenterWidgetInHBox(hbox, border_bin_aa, true, 0); // We take care to avoid showing the slide animator widget. gtk_widget_show_all(container_); diff --git a/chrome/browser/gtk/first_run_bubble.cc b/chrome/browser/gtk/first_run_bubble.cc index 4c3a502..12127bd 100644 --- a/chrome/browser/gtk/first_run_bubble.cc +++ b/chrome/browser/gtk/first_run_bubble.cc @@ -110,7 +110,7 @@ FirstRunBubble::FirstRunBubble(Profile* profile, content_ = gtk_vbox_new(FALSE, 5); int width, height; - GtkUtil::GetWidgetSizeFromResources(content_, + gtk_util::GetWidgetSizeFromResources(content_, IDS_FIRSTRUNBUBBLE_DIALOG_WIDTH_CHARS, IDS_FIRSTRUNBUBBLE_DIALOG_HEIGHT_LINES, &width, &height); diff --git a/chrome/browser/gtk/first_run_dialog.cc b/chrome/browser/gtk/first_run_dialog.cc index 2758a96..50f2321 100644 --- a/chrome/browser/gtk/first_run_dialog.cc +++ b/chrome/browser/gtk/first_run_dialog.cc @@ -37,10 +37,10 @@ FirstRunDialog::FirstRunDialog(Profile* profile, int& response) NULL); gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); int width, height; - GtkUtil::GetWidgetSizeFromResources(dialog_, - IDS_FIRSTRUN_DIALOG_WIDTH_CHARS, - IDS_FIRSTRUN_DIALOG_HEIGHT_LINES, - &width, &height); + gtk_util::GetWidgetSizeFromResources(dialog_, + IDS_FIRSTRUN_DIALOG_WIDTH_CHARS, + IDS_FIRSTRUN_DIALOG_HEIGHT_LINES, + &width, &height); gtk_window_set_default_size(GTK_WINDOW(dialog_), width, height); g_signal_connect(G_OBJECT(dialog_), "delete-event", G_CALLBACK(gtk_widget_hide_on_delete), NULL); @@ -80,7 +80,7 @@ FirstRunDialog::FirstRunDialog(Profile* profile, int& response) l10n_util::GetStringUTF8(IDS_FR_CUSTOMIZE_DEFAULT_BROWSER).c_str()); gtk_box_pack_start(GTK_BOX(vbox), make_default_, FALSE, FALSE, 0); - GtkWidget* combo_hbox = gtk_hbox_new(FALSE, GtkUtil::kLabelSpacing); + GtkWidget* combo_hbox = gtk_hbox_new(FALSE, gtk_util::kLabelSpacing); import_data_ = gtk_check_button_new_with_label( l10n_util::GetStringUTF8(IDS_FR_CUSTOMIZE_IMPORT).c_str()); gtk_box_pack_start(GTK_BOX(combo_hbox), import_data_, FALSE, FALSE, 0); diff --git a/chrome/browser/gtk/hung_renderer_dialog_gtk.cc b/chrome/browser/gtk/hung_renderer_dialog_gtk.cc index f48e01b..6ddf34c 100644 --- a/chrome/browser/gtk/hung_renderer_dialog_gtk.cc +++ b/chrome/browser/gtk/hung_renderer_dialog_gtk.cc @@ -74,7 +74,7 @@ void HungRendererDialogGtk::Init() { l10n_util::GetStringUTF8(IDS_BROWSER_HANGMONITOR_RENDERER_WAIT).c_str(), GTK_RESPONSE_OK, NULL)); - GtkUtil::SetWindowIcon(GTK_WINDOW(dialog_)); + gtk_util::SetWindowIcon(GTK_WINDOW(dialog_)); gtk_dialog_set_default_response(dialog_, GTK_RESPONSE_OK); g_signal_connect(dialog_, "response", G_CALLBACK(OnDialogResponseThunk), this); @@ -96,7 +96,7 @@ void HungRendererDialogGtk::Init() { // | kill button wait button| // ·-----------------------------------· GtkWidget* contents_vbox = dialog_->vbox; - gtk_box_set_spacing(GTK_BOX(contents_vbox), GtkUtil::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(contents_vbox), gtk_util::kContentAreaSpacing); GtkWidget* hbox = gtk_hbox_new(FALSE, 12); gtk_box_pack_start(GTK_BOX(contents_vbox), hbox, TRUE, TRUE, 0); @@ -109,7 +109,7 @@ void HungRendererDialogGtk::Init() { GtkWidget* icon = gtk_image_new_from_pixbuf(icon_pixbuf); gtk_box_pack_start(GTK_BOX(icon_vbox), icon, FALSE, FALSE, 0); - GtkWidget* vbox = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); GtkWidget* text = gtk_label_new( diff --git a/chrome/browser/gtk/import_dialog_gtk.cc b/chrome/browser/gtk/import_dialog_gtk.cc index 11b732e..33a12cb 100644 --- a/chrome/browser/gtk/import_dialog_gtk.cc +++ b/chrome/browser/gtk/import_dialog_gtk.cc @@ -48,9 +48,9 @@ ImportDialogGtk::ImportDialogGtk(GtkWindow* parent, Profile* profile) : gtk_widget_set_size_request(dialog_, 300, -1); GtkWidget* content_area = GTK_DIALOG(dialog_)->vbox; - gtk_box_set_spacing(GTK_BOX(content_area), GtkUtil::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); - GtkWidget* combo_hbox = gtk_hbox_new(FALSE, GtkUtil::kLabelSpacing); + GtkWidget* combo_hbox = gtk_hbox_new(FALSE, gtk_util::kLabelSpacing); GtkWidget* from = gtk_label_new( l10n_util::GetStringUTF8(IDS_IMPORT_FROM_LABEL).c_str()); gtk_box_pack_start(GTK_BOX(combo_hbox), from, FALSE, FALSE, 0); @@ -60,7 +60,7 @@ ImportDialogGtk::ImportDialogGtk(GtkWindow* parent, Profile* profile) : gtk_box_pack_start(GTK_BOX(content_area), combo_hbox, FALSE, FALSE, 0); - GtkWidget* vbox = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); GtkWidget* description = gtk_label_new( l10n_util::GetStringUTF8(IDS_IMPORT_ITEMS_LABEL).c_str()); diff --git a/chrome/browser/gtk/import_lock_dialog_gtk.cc b/chrome/browser/gtk/import_lock_dialog_gtk.cc index cc536cd..465ccea 100644 --- a/chrome/browser/gtk/import_lock_dialog_gtk.cc +++ b/chrome/browser/gtk/import_lock_dialog_gtk.cc @@ -31,7 +31,7 @@ ImportLockDialogGtk::ImportLockDialogGtk(GtkWindow* parent, NULL); GtkWidget* content_area = GTK_DIALOG(dialog_)->vbox; - gtk_box_set_spacing(GTK_BOX(content_area), GtkUtil::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); GtkWidget* label = gtk_label_new( l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_TEXT).c_str()); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); diff --git a/chrome/browser/gtk/import_progress_dialog_gtk.cc b/chrome/browser/gtk/import_progress_dialog_gtk.cc index 2a3c4d6..d44aac4 100644 --- a/chrome/browser/gtk/import_progress_dialog_gtk.cc +++ b/chrome/browser/gtk/import_progress_dialog_gtk.cc @@ -125,7 +125,7 @@ ImportProgressDialogGtk::ImportProgressDialogGtk(const string16& source_profile, importer_host_->set_parent_window(GTK_WINDOW(dialog_)); GtkWidget* content_area = GTK_DIALOG(dialog_)->vbox; - gtk_box_set_spacing(GTK_BOX(content_area), GtkUtil::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); GtkWidget* import_info = gtk_label_new( l10n_util::GetStringFUTF8(IDS_IMPORT_PROGRESS_INFO, diff --git a/chrome/browser/gtk/infobar_container_gtk.cc b/chrome/browser/gtk/infobar_container_gtk.cc index 0cc648d..9489026 100644 --- a/chrome/browser/gtk/infobar_container_gtk.cc +++ b/chrome/browser/gtk/infobar_container_gtk.cc @@ -64,7 +64,7 @@ void InfoBarContainerGtk::ChangeTabContents(TabContents* contents) { if (tab_contents_) registrar_.RemoveAll(); - GtkUtil::RemoveAllChildren(widget()); + gtk_util::RemoveAllChildren(widget()); tab_contents_ = contents; if (tab_contents_) { diff --git a/chrome/browser/gtk/infobar_gtk.cc b/chrome/browser/gtk/infobar_gtk.cc index aa9456f..4acc96f 100644 --- a/chrome/browser/gtk/infobar_gtk.cc +++ b/chrome/browser/gtk/infobar_gtk.cc @@ -80,8 +80,8 @@ InfoBar::InfoBar(InfoBarDelegate* delegate) // The -1 on the kInfoBarHeight is to account for the border. gtk_widget_set_size_request(bg_box, -1, kInfoBarHeight - 1); - border_bin_.Own(GtkUtil::CreateGtkBorderBin(bg_box, &kBorderColor, - 0, 1, 0, 0)); + border_bin_.Own(gtk_util::CreateGtkBorderBin(bg_box, &kBorderColor, + 0, 1, 0, 0)); // Add the icon on the left, if any. SkBitmap* icon = delegate->GetIcon(); @@ -94,7 +94,7 @@ InfoBar::InfoBar(InfoBarDelegate* delegate) // TODO(erg): GTK theme the info bar. close_button_.reset(CustomDrawButton::CloseButton(NULL)); - GtkUtil::CenterWidgetInHBox(hbox_, close_button_->widget(), true, 0); + gtk_util::CenterWidgetInHBox(hbox_, close_button_->widget(), true, 0); g_signal_connect(close_button_->widget(), "clicked", G_CALLBACK(OnCloseButton), this); @@ -207,7 +207,7 @@ class LinkInfoBar : public InfoBar { // this hbox that doesn't use kElementPadding. GtkWidget* hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), initial_label, FALSE, FALSE, 0); - GtkUtil::CenterWidgetInHBox(hbox, link_button, false, 0); + gtk_util::CenterWidgetInHBox(hbox, link_button, false, 0); gtk_box_pack_start(GTK_BOX(hbox), trailing_label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox_), hbox, FALSE, FALSE, 0); } @@ -252,7 +252,7 @@ class ConfirmInfoBar : public AlertInfoBar { if (delegate_->AsConfirmInfoBarDelegate()->GetButtons() & type) { GtkWidget* button = gtk_button_new_with_label(WideToUTF8( delegate_->AsConfirmInfoBarDelegate()->GetButtonLabel(type)).c_str()); - GtkUtil::CenterWidgetInHBox(hbox_, button, true, 0); + gtk_util::CenterWidgetInHBox(hbox_, button, true, 0); g_signal_connect(button, "clicked", G_CALLBACK(type == ConfirmInfoBarDelegate::BUTTON_OK ? OnOkButton : OnCancelButton), diff --git a/chrome/browser/gtk/keyword_editor_view.cc b/chrome/browser/gtk/keyword_editor_view.cc index 002ede5..a2e098e 100644 --- a/chrome/browser/gtk/keyword_editor_view.cc +++ b/chrome/browser/gtk/keyword_editor_view.cc @@ -91,14 +91,14 @@ void KeywordEditorView::Init() { GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); - GtkUtil::SetWindowIcon(GTK_WINDOW(dialog_)); + gtk_util::SetWindowIcon(GTK_WINDOW(dialog_)); gtk_window_set_default_size(GTK_WINDOW(dialog_), kDialogDefaultWidth, kDialogDefaultHeight); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), - GtkUtil::kContentAreaSpacing); + gtk_util::kContentAreaSpacing); - GtkWidget* hbox = gtk_hbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog_)->vbox), hbox); GtkWidget* scroll_window = gtk_scrolled_window_new(NULL, NULL); @@ -159,7 +159,7 @@ void KeywordEditorView::Init() { g_signal_connect(G_OBJECT(selection_), "changed", G_CALLBACK(OnSelectionChanged), this); - GtkWidget* button_box = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* button_box = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(hbox), button_box, FALSE, FALSE, 0); add_button_ = gtk_button_new_with_label( diff --git a/chrome/browser/gtk/location_bar_view_gtk.cc b/chrome/browser/gtk/location_bar_view_gtk.cc index f3a2618..33bdac0 100644 --- a/chrome/browser/gtk/location_bar_view_gtk.cc +++ b/chrome/browser/gtk/location_bar_view_gtk.cc @@ -169,8 +169,8 @@ void LocationBarViewGtk::Init(bool popup_window_mode) { // This crazy stack of alignments and event boxes creates a box around the // keyword text with a border, background color, and padding around the text. gtk_container_add(GTK_CONTAINER(tab_to_search_), - GtkUtil::CreateGtkBorderBin( - GtkUtil::CreateGtkBorderBin( + gtk_util::CreateGtkBorderBin( + gtk_util::CreateGtkBorderBin( tab_to_search_label_, &kKeywordBackgroundColor, 1, 1, 2, 2), &kKeywordBorderColor, 1, 1, 1, 1)); diff --git a/chrome/browser/gtk/menu_gtk.cc b/chrome/browser/gtk/menu_gtk.cc index 1548e44..f0a85d8 100644 --- a/chrome/browser/gtk/menu_gtk.cc +++ b/chrome/browser/gtk/menu_gtk.cc @@ -13,6 +13,8 @@ #include "chrome/common/gtk_util.h" #include "third_party/skia/include/core/SkBitmap.h" +using gtk_util::ConvertAcceleratorsFromWindowsStyle; + MenuGtk::MenuGtk(MenuGtk::Delegate* delegate, const MenuCreateMaterial* menu_data, GtkAccelGroup* accel_group) @@ -45,9 +47,9 @@ void MenuGtk::ConnectSignalHandlers() { void MenuGtk::AppendMenuItemWithLabel(int command_id, const std::string& label) { - std::string converted = GtkUtil::ConvertAcceleratorsFromWindowsStyle(label); + std::string converted_label = ConvertAcceleratorsFromWindowsStyle(label); GtkWidget* menu_item = - gtk_menu_item_new_with_mnemonic(converted.c_str()); + gtk_menu_item_new_with_mnemonic(converted_label.c_str()); AppendMenuItem(command_id, menu_item); } @@ -60,9 +62,9 @@ void MenuGtk::AppendMenuItemWithIcon(int command_id, void MenuGtk::AppendCheckMenuItemWithLabel(int command_id, const std::string& label) { - std::string converted = GtkUtil::ConvertAcceleratorsFromWindowsStyle(label); + std::string converted_label = ConvertAcceleratorsFromWindowsStyle(label); GtkWidget* menu_item = - gtk_check_menu_item_new_with_mnemonic(converted.c_str()); + gtk_check_menu_item_new_with_mnemonic(converted_label.c_str()); AppendMenuItem(command_id, menu_item); } @@ -133,7 +135,7 @@ void MenuGtk::BuildMenuIn(GtkWidget* menu, DCHECK(!label.empty()); } - label = GtkUtil::ConvertAcceleratorsFromWindowsStyle(label); + label = ConvertAcceleratorsFromWindowsStyle(label); switch (menu_data->type) { case MENU_RADIO: @@ -193,9 +195,9 @@ void MenuGtk::BuildMenuIn(GtkWidget* menu, GtkWidget* MenuGtk::BuildMenuItemWithImage(const std::string& label, const SkBitmap& icon) { - std::string converted = GtkUtil::ConvertAcceleratorsFromWindowsStyle(label); + std::string converted_label = ConvertAcceleratorsFromWindowsStyle(label); GtkWidget* menu_item = - gtk_image_menu_item_new_with_mnemonic(converted.c_str()); + gtk_image_menu_item_new_with_mnemonic(converted_label.c_str()); GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&icon); gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_item), diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.cc b/chrome/browser/gtk/options/advanced_contents_gtk.cc index 96ab10e..4e615e5 100644 --- a/chrome/browser/gtk/options/advanced_contents_gtk.cc +++ b/chrome/browser/gtk/options/advanced_contents_gtk.cc @@ -149,7 +149,7 @@ class DownloadSection : public OptionsPageBase { DownloadSection::DownloadSection(Profile* profile) : OptionsPageBase(profile), initializing_(true) { - page_ = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + page_ = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); // Download location options. download_location_button_ = gtk_file_chooser_button_new( @@ -174,7 +174,7 @@ DownloadSection::DownloadSection(Profile* profile) } } - GtkWidget* download_location_control = GtkUtil::CreateLabeledControlsGroup( + GtkWidget* download_location_control = gtk_util::CreateLabeledControlsGroup( NULL, l10n_util::GetStringUTF8( IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE).c_str(), @@ -313,7 +313,7 @@ class NetworkSection : public OptionsPageBase { NetworkSection::NetworkSection(Profile* profile) : OptionsPageBase(profile) { - page_ = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + page_ = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); GtkWidget* proxy_description_label = CreateWrappedLabel( IDS_OPTIONS_PROXIES_LABEL); @@ -472,7 +472,7 @@ class PrivacySection : public OptionsPageBase { PrivacySection::PrivacySection(Profile* profile) : OptionsPageBase(profile), initializing_(true) { - page_ = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + page_ = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); GtkWidget* section_description_label = CreateWrappedLabel( IDS_OPTIONS_DISABLE_SERVICES); @@ -533,7 +533,7 @@ PrivacySection::PrivacySection(Profile* profile) gtk_misc_set_alignment(GTK_MISC(cookie_description_label), 0, 0); gtk_box_pack_start(GTK_BOX(page_), cookie_description_label, FALSE, FALSE, 0); - GtkWidget* cookie_controls = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* cookie_controls = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(page_), OptionsLayoutBuilderGtk::IndentWidget(cookie_controls), FALSE, FALSE, 0); @@ -792,7 +792,7 @@ class SecuritySection : public OptionsPageBase { SecuritySection::SecuritySection(Profile* profile) : OptionsPageBase(profile) { - page_ = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + page_ = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); GtkWidget* manage_certificates_label = CreateWrappedLabel( IDS_OPTIONS_CERTIFICATES_LABEL); @@ -850,7 +850,7 @@ class WebContentSection : public OptionsPageBase { WebContentSection::WebContentSection(Profile* profile) : OptionsPageBase(profile) { - page_ = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + page_ = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); GtkWidget* fonts_and_languages_label = CreateWrappedLabel( IDS_OPTIONS_FONTSETTINGS_INFO); diff --git a/chrome/browser/gtk/options/advanced_page_gtk.cc b/chrome/browser/gtk/options/advanced_page_gtk.cc index f1cbd99..517669a 100644 --- a/chrome/browser/gtk/options/advanced_page_gtk.cc +++ b/chrome/browser/gtk/options/advanced_page_gtk.cc @@ -20,9 +20,9 @@ AdvancedPageGtk::~AdvancedPageGtk() { } void AdvancedPageGtk::Init() { - page_ = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + page_ = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_container_set_border_width(GTK_CONTAINER(page_), - GtkUtil::kContentAreaBorder); + gtk_util::kContentAreaBorder); GtkWidget* scroll_window = gtk_scrolled_window_new(NULL, NULL); gtk_container_add(GTK_CONTAINER(page_), scroll_window); diff --git a/chrome/browser/gtk/options/content_page_gtk.cc b/chrome/browser/gtk/options/content_page_gtk.cc index 5e19dc6..3d8d9f6 100644 --- a/chrome/browser/gtk/options/content_page_gtk.cc +++ b/chrome/browser/gtk/options/content_page_gtk.cc @@ -82,7 +82,7 @@ void ContentPageGtk::NotifyPrefChanged(const std::wstring* pref_name) { // ContentPageGtk, private: GtkWidget* ContentPageGtk::InitPasswordSavingGroup() { - GtkWidget* vbox = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); // Ask to save radio button. passwords_asktosave_radio_ = gtk_radio_button_new_with_label(NULL, @@ -103,7 +103,7 @@ GtkWidget* ContentPageGtk::InitPasswordSavingGroup() { // Add the exceptions button into its own horizontal box so it does not // depend on the spacing above. - GtkWidget* button_hbox = gtk_hbox_new(FALSE, GtkUtil::kLabelSpacing); + GtkWidget* button_hbox = gtk_hbox_new(FALSE, gtk_util::kLabelSpacing); 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()); @@ -116,7 +116,7 @@ GtkWidget* ContentPageGtk::InitPasswordSavingGroup() { } GtkWidget* ContentPageGtk::InitFormAutofillGroup() { - GtkWidget* vbox = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); // Ask to save radio button. form_autofill_asktosave_radio_ = gtk_radio_button_new_with_label(NULL, @@ -139,7 +139,7 @@ GtkWidget* ContentPageGtk::InitFormAutofillGroup() { } GtkWidget* ContentPageGtk::InitBrowsingDataGroup() { - GtkWidget* vbox = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); // Browsing data label. GtkWidget* browsing_data_label = gtk_label_new( @@ -149,7 +149,7 @@ GtkWidget* ContentPageGtk::InitBrowsingDataGroup() { gtk_box_pack_start(GTK_BOX(vbox), browsing_data_label, FALSE, FALSE, 0); // Horizontal two button layout. - GtkWidget* button_hbox = gtk_hbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* button_hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); gtk_container_add(GTK_CONTAINER(vbox), button_hbox); // Import button. @@ -170,7 +170,7 @@ GtkWidget* ContentPageGtk::InitBrowsingDataGroup() { } GtkWidget* ContentPageGtk::InitThemesGroup() { - GtkWidget* hbox = gtk_hbox_new(FALSE, GtkUtil::kLabelSpacing); + GtkWidget* hbox = gtk_hbox_new(FALSE, gtk_util::kLabelSpacing); // GTK theme button. GtkWidget* gtk_theme_button = gtk_button_new_with_label( diff --git a/chrome/browser/gtk/options/cookies_view.cc b/chrome/browser/gtk/options/cookies_view.cc index 19cb8d0..b22850e 100644 --- a/chrome/browser/gtk/options/cookies_view.cc +++ b/chrome/browser/gtk/options/cookies_view.cc @@ -84,7 +84,7 @@ void CookiesView::Init() { remove_button_ = gtk_dialog_add_button( GTK_DIALOG(dialog_), - GtkUtil::ConvertAcceleratorsFromWindowsStyle( + gtk_util::ConvertAcceleratorsFromWindowsStyle( l10n_util::GetStringUTF8(IDS_COOKIES_REMOVE_LABEL)).c_str(), RESPONSE_REMOVE); gtk_button_box_set_child_secondary( @@ -94,7 +94,7 @@ void CookiesView::Init() { remove_all_button_ = gtk_dialog_add_button( GTK_DIALOG(dialog_), - GtkUtil::ConvertAcceleratorsFromWindowsStyle( + gtk_util::ConvertAcceleratorsFromWindowsStyle( l10n_util::GetStringUTF8(IDS_COOKIES_REMOVE_ALL_LABEL)).c_str(), RESPONSE_REMOVE_ALL); gtk_button_box_set_child_secondary( @@ -106,12 +106,12 @@ void CookiesView::Init() { gtk_window_set_default_size(GTK_WINDOW(dialog_), kDialogDefaultWidth, kDialogDefaultHeight); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), - GtkUtil::kContentAreaSpacing); + gtk_util::kContentAreaSpacing); g_signal_connect(dialog_, "response", G_CALLBACK(OnResponse), this); g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroy), this); // Filtering controls. - GtkWidget* filter_hbox = gtk_hbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* filter_hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); filter_entry_ = gtk_entry_new(); g_signal_connect(G_OBJECT(filter_entry_), "activate", G_CALLBACK(OnFilterEntryActivated), this); @@ -120,21 +120,21 @@ void CookiesView::Init() { gtk_box_pack_start(GTK_BOX(filter_hbox), filter_entry_, TRUE, TRUE, 0); filter_clear_button_ = gtk_button_new_with_mnemonic( - GtkUtil::ConvertAcceleratorsFromWindowsStyle( + gtk_util::ConvertAcceleratorsFromWindowsStyle( l10n_util::GetStringUTF8(IDS_COOKIES_CLEAR_SEARCH_LABEL)).c_str()); g_signal_connect(G_OBJECT(filter_clear_button_), "clicked", G_CALLBACK(OnFilterClearButtonClicked), this); gtk_box_pack_start(GTK_BOX(filter_hbox), filter_clear_button_, FALSE, FALSE, 0); - GtkWidget* filter_controls = GtkUtil::CreateLabeledControlsGroup(NULL, + GtkWidget* filter_controls = gtk_util::CreateLabeledControlsGroup(NULL, l10n_util::GetStringUTF8(IDS_COOKIES_SEARCH_LABEL).c_str(), filter_hbox, NULL); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), filter_controls, FALSE, FALSE, 0); // Cookie list. - GtkWidget* cookie_list_vbox = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* cookie_list_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), cookie_list_vbox, TRUE, TRUE, 0); @@ -203,7 +203,7 @@ void CookiesView::Init() { cookie_details_table_ = gtk_table_new(7, 2, FALSE); gtk_container_add(GTK_CONTAINER(details_frame), cookie_details_table_); gtk_table_set_col_spacing(GTK_TABLE(cookie_details_table_), 0, - GtkUtil::kLabelSpacing); + gtk_util::kLabelSpacing); InitCookieDetailRow(0, IDS_COOKIES_COOKIE_NAME_LABEL, &cookie_name_entry_); InitCookieDetailRow(1, IDS_COOKIES_COOKIE_CONTENT_LABEL, @@ -289,7 +289,7 @@ void CookiesView::PopulateCookieDetails() { NOTREACHED(); return; } - int selected_index = GtkTreeUtil::GetTreeSortChildRowNumForPath( + int selected_index = gtk_tree_util::GetTreeSortChildRowNumForPath( list_sort_, static_cast<GtkTreePath*>(list->data)); g_list_foreach(list, (GFunc)gtk_tree_path_free, NULL); g_list_free(list); @@ -341,7 +341,7 @@ void CookiesView::RemoveSelectedCookies() { GList* node; size_t i; for (i = 0, node = list; node != NULL; ++i, node = node->next) { - selected_rows[i] = GtkTreeUtil::GetTreeSortChildRowNumForPath( + selected_rows[i] = gtk_tree_util::GetTreeSortChildRowNumForPath( list_sort_, static_cast<GtkTreePath*>(node->data)); } g_list_foreach(list, (GFunc)gtk_tree_path_free, NULL); @@ -423,8 +423,8 @@ void CookiesView::OnItemsRemoved(int start, int length) { // static gint CookiesView::CompareSite(GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b, gpointer window) { - int row1 = GtkTreeUtil::GetRowNumForIter(model, a); - int row2 = GtkTreeUtil::GetRowNumForIter(model, b); + int row1 = gtk_tree_util::GetRowNumForIter(model, a); + int row2 = gtk_tree_util::GetRowNumForIter(model, b); return reinterpret_cast<CookiesView*>(window)->cookies_table_model_-> CompareValues(row1, row2, IDS_COOKIES_DOMAIN_COLUMN_HEADER); } @@ -432,8 +432,8 @@ gint CookiesView::CompareSite(GtkTreeModel* model, GtkTreeIter* a, // static gint CookiesView::CompareCookieName(GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b, gpointer window) { - int row1 = GtkTreeUtil::GetRowNumForIter(model, a); - int row2 = GtkTreeUtil::GetRowNumForIter(model, b); + int row1 = gtk_tree_util::GetRowNumForIter(model, a); + int row2 = gtk_tree_util::GetRowNumForIter(model, b); return reinterpret_cast<CookiesView*>(window)->cookies_table_model_-> CompareValues(row1, row2, IDS_COOKIES_NAME_COLUMN_HEADER); } diff --git a/chrome/browser/gtk/options/exceptions_page_gtk.cc b/chrome/browser/gtk/options/exceptions_page_gtk.cc index ceb310f..638a1a7 100644 --- a/chrome/browser/gtk/options/exceptions_page_gtk.cc +++ b/chrome/browser/gtk/options/exceptions_page_gtk.cc @@ -44,7 +44,7 @@ ExceptionsPageGtk::ExceptionsPageGtk(Profile* profile) g_signal_connect(G_OBJECT(remove_all_button_), "clicked", G_CALLBACK(OnRemoveAllButtonClicked), this); - GtkWidget* buttons = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* buttons = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(buttons), remove_button_, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(buttons), remove_all_button_, FALSE, FALSE, 0); @@ -58,9 +58,9 @@ ExceptionsPageGtk::ExceptionsPageGtk(Profile* profile) InitExceptionTree(); gtk_container_add(GTK_CONTAINER(scroll_window), exception_tree_); - page_ = gtk_hbox_new(FALSE, GtkUtil::kControlSpacing); + page_ = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); gtk_container_set_border_width(GTK_CONTAINER(page_), - GtkUtil::kContentAreaBorder); + gtk_util::kContentAreaBorder); gtk_box_pack_end(GTK_BOX(page_), buttons, FALSE, FALSE, 0); gtk_box_pack_end(GTK_BOX(page_), scroll_window, TRUE, TRUE, 0); } @@ -133,7 +133,7 @@ void ExceptionsPageGtk::OnRemoveButtonClicked(GtkButton* widget, GtkTreePath* path = gtk_tree_model_get_path( GTK_TREE_MODEL(page->exception_list_sort_), &iter); - gint index = GtkTreeUtil::GetTreeSortChildRowNumForPath( + gint index = gtk_tree_util::GetTreeSortChildRowNumForPath( page->exception_list_sort_, path); gtk_tree_path_free(path); @@ -178,8 +178,8 @@ void ExceptionsPageGtk::OnExceptionSelectionChanged(GtkTreeSelection* selection, gint ExceptionsPageGtk::CompareSite(GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b, gpointer window) { - int row1 = GtkTreeUtil::GetRowNumForIter(model, a); - int row2 = GtkTreeUtil::GetRowNumForIter(model, b); + int row1 = gtk_tree_util::GetRowNumForIter(model, a); + int row2 = gtk_tree_util::GetRowNumForIter(model, b); ExceptionsPageGtk* page = reinterpret_cast<ExceptionsPageGtk*>(window); return page->exception_list_[row1].origin.spec().compare( page->exception_list_[row2].origin.spec()); diff --git a/chrome/browser/gtk/options/fonts_languages_window_gtk.cc b/chrome/browser/gtk/options/fonts_languages_window_gtk.cc index 5192b90..9274f12 100644 --- a/chrome/browser/gtk/options/fonts_languages_window_gtk.cc +++ b/chrome/browser/gtk/options/fonts_languages_window_gtk.cc @@ -69,7 +69,7 @@ FontsLanguagesWindowGtk::FontsLanguagesWindowGtk(Profile* profile) NULL); gtk_window_set_default_size(GTK_WINDOW(dialog_), 500, -1); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), - GtkUtil::kContentAreaSpacing); + gtk_util::kContentAreaSpacing); notebook_ = gtk_notebook_new(); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog_)->vbox), notebook_); diff --git a/chrome/browser/gtk/options/fonts_page_gtk.cc b/chrome/browser/gtk/options/fonts_page_gtk.cc index a46b6ff..e75369a 100644 --- a/chrome/browser/gtk/options/fonts_page_gtk.cc +++ b/chrome/browser/gtk/options/fonts_page_gtk.cc @@ -54,7 +54,7 @@ void FontsPageGtk::Init() { g_signal_connect(fixed_font_button_, "font-set", G_CALLBACK(OnFixedFontSet), this); - GtkWidget* font_controls = GtkUtil::CreateLabeledControlsGroup(NULL, + GtkWidget* font_controls = gtk_util::CreateLabeledControlsGroup(NULL, l10n_util::GetStringUTF8( IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_SERIF_LABEL).c_str(), serif_font_button_, @@ -73,7 +73,7 @@ void FontsPageGtk::Init() { InitDefaultEncodingComboBox(); std::string encoding_group_description = l10n_util::GetStringUTF8( IDS_FONT_LANGUAGE_SETTING_FONT_DEFAULT_ENCODING_SELECTOR_LABEL); - GtkWidget* encoding_controls = GtkUtil::CreateLabeledControlsGroup(NULL, + GtkWidget* encoding_controls = gtk_util::CreateLabeledControlsGroup(NULL, encoding_group_description.c_str(), default_encoding_combobox_, NULL); diff --git a/chrome/browser/gtk/options/general_page_gtk.cc b/chrome/browser/gtk/options/general_page_gtk.cc index 7036ff1..636d2e0 100644 --- a/chrome/browser/gtk/options/general_page_gtk.cc +++ b/chrome/browser/gtk/options/general_page_gtk.cc @@ -171,7 +171,7 @@ void GeneralPageGtk::HighlightGroup(OptionsGroup highlight_group) { // GeneralPageGtk, private: GtkWidget* GeneralPageGtk::InitStartupGroup() { - GtkWidget* vbox = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); startup_homepage_radio_ = gtk_radio_button_new_with_label(NULL, l10n_util::GetStringUTF8( @@ -196,7 +196,7 @@ GtkWidget* GeneralPageGtk::InitStartupGroup() { gtk_box_pack_start(GTK_BOX(vbox), startup_custom_radio_, FALSE, FALSE, 0); GtkWidget* url_list_container = gtk_hbox_new(FALSE, - GtkUtil::kControlSpacing); + gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(vbox), url_list_container, TRUE, TRUE, 0); GtkWidget* scroll_window = gtk_scrolled_window_new(NULL, NULL); @@ -238,26 +238,26 @@ GtkWidget* GeneralPageGtk::InitStartupGroup() { profile(), &fav_icon_consumer_)); - GtkWidget* url_list_buttons = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* url_list_buttons = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_end(GTK_BOX(url_list_container), url_list_buttons, FALSE, FALSE, 0); startup_add_custom_page_button_ = gtk_button_new_with_mnemonic( - GtkUtil::ConvertAcceleratorsFromWindowsStyle( + 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_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( - GtkUtil::ConvertAcceleratorsFromWindowsStyle( + 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_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( - GtkUtil::ConvertAcceleratorsFromWindowsStyle( + 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_CALLBACK(OnStartupUseCurrentPageClicked), this); @@ -268,7 +268,7 @@ GtkWidget* GeneralPageGtk::InitStartupGroup() { } GtkWidget* GeneralPageGtk::InitHomepageGroup() { - GtkWidget* vbox = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); homepage_use_newtab_radio_ = gtk_radio_button_new_with_label(NULL, l10n_util::GetStringUTF8(IDS_OPTIONS_HOMEPAGE_USE_NEWTAB).c_str()); @@ -276,7 +276,7 @@ GtkWidget* GeneralPageGtk::InitHomepageGroup() { G_CALLBACK(OnNewTabIsHomePageToggled), this); gtk_container_add(GTK_CONTAINER(vbox), homepage_use_newtab_radio_); - GtkWidget* homepage_hbox = gtk_hbox_new(FALSE, GtkUtil::kLabelSpacing); + GtkWidget* homepage_hbox = gtk_hbox_new(FALSE, gtk_util::kLabelSpacing); gtk_container_add(GTK_CONTAINER(vbox), homepage_hbox); homepage_use_url_radio_ = gtk_radio_button_new_with_label_from_widget( @@ -302,7 +302,7 @@ GtkWidget* GeneralPageGtk::InitHomepageGroup() { } GtkWidget* GeneralPageGtk::InitDefaultSearchGroup() { - GtkWidget* hbox = gtk_hbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); default_search_engines_model_ = gtk_list_store_new(SEARCH_ENGINES_COL_COUNT, G_TYPE_UINT, @@ -340,7 +340,7 @@ GtkWidget* GeneralPageGtk::InitDefaultSearchGroup() { } GtkWidget* GeneralPageGtk::InitDefaultBrowserGroup() { - GtkWidget* vbox = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); // TODO(mattm): the label should be created with a text like "checking for // default" to be displayed while we wait for the check to complete. diff --git a/chrome/browser/gtk/options/options_layout_gtk.cc b/chrome/browser/gtk/options/options_layout_gtk.cc index b837a84a..a2507fe 100644 --- a/chrome/browser/gtk/options/options_layout_gtk.cc +++ b/chrome/browser/gtk/options/options_layout_gtk.cc @@ -14,9 +14,9 @@ const char kGroupTitleMarkup[] = } OptionsLayoutBuilderGtk::OptionsLayoutBuilderGtk() { - page_ = gtk_vbox_new(FALSE, GtkUtil::kContentAreaSpacing); + page_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaSpacing); gtk_container_set_border_width(GTK_CONTAINER(page_), - GtkUtil::kContentAreaBorder); + gtk_util::kContentAreaBorder); } void OptionsLayoutBuilderGtk::AddOptionGroup(const std::string& title, @@ -33,7 +33,7 @@ void OptionsLayoutBuilderGtk::AddOptionGroup(const std::string& title, GtkWidget* content_alignment = IndentWidget(content); - GtkWidget* group = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* group = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(group), title_alignment, FALSE, FALSE, 0); gtk_container_add(GTK_CONTAINER(group), content_alignment); @@ -44,7 +44,7 @@ void OptionsLayoutBuilderGtk::AddOptionGroup(const std::string& title, GtkWidget* OptionsLayoutBuilderGtk::IndentWidget(GtkWidget* content) { GtkWidget* content_alignment = gtk_alignment_new(0.0, 0.5, 1.0, 1.0); gtk_alignment_set_padding(GTK_ALIGNMENT(content_alignment), 0, 0, - GtkUtil::kGroupIndent, 0); + gtk_util::kGroupIndent, 0); gtk_container_add(GTK_CONTAINER(content_alignment), content); return content_alignment; } diff --git a/chrome/browser/gtk/options/options_window_gtk.cc b/chrome/browser/gtk/options/options_window_gtk.cc index 7aaa065..86e188a 100644 --- a/chrome/browser/gtk/options/options_window_gtk.cc +++ b/chrome/browser/gtk/options/options_window_gtk.cc @@ -99,8 +99,8 @@ OptionsWindowGtk::OptionsWindowGtk(Profile* profile) NULL); gtk_window_set_default_size(GTK_WINDOW(dialog_), 500, -1); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), - GtkUtil::kContentAreaSpacing); - GtkUtil::SetWindowIcon(GTK_WINDOW(dialog_)); + gtk_util::kContentAreaSpacing); + gtk_util::SetWindowIcon(GTK_WINDOW(dialog_)); notebook_ = gtk_notebook_new(); diff --git a/chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc b/chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc index db5ccb8..195a662 100644 --- a/chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc +++ b/chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc @@ -80,8 +80,8 @@ PasswordsExceptionsWindowGtk::PasswordsExceptionsWindowGtk(Profile* profile) gtk_window_set_default_size(GTK_WINDOW(dialog_), kPasswordsExceptionsWindowInitialWidth, -1); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), - GtkUtil::kContentAreaSpacing); - GtkUtil::SetWindowIcon(GTK_WINDOW(dialog_)); + gtk_util::kContentAreaSpacing); + gtk_util::SetWindowIcon(GTK_WINDOW(dialog_)); notebook_ = gtk_notebook_new(); diff --git a/chrome/browser/gtk/options/passwords_page_gtk.cc b/chrome/browser/gtk/options/passwords_page_gtk.cc index be47c06..9a2f795 100644 --- a/chrome/browser/gtk/options/passwords_page_gtk.cc +++ b/chrome/browser/gtk/options/passwords_page_gtk.cc @@ -71,7 +71,7 @@ PasswordsPageGtk::PasswordsPageGtk(Profile* profile) password_ = gtk_label_new(""); - GtkWidget* buttons = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* buttons = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(buttons), remove_button_, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(buttons), remove_all_button_, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(buttons), show_password_button_, FALSE, FALSE, 0); @@ -87,9 +87,9 @@ PasswordsPageGtk::PasswordsPageGtk(Profile* profile) InitPasswordTree(); gtk_container_add(GTK_CONTAINER(scroll_window), password_tree_); - page_ = gtk_hbox_new(FALSE, GtkUtil::kControlSpacing); + page_ = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); gtk_container_set_border_width(GTK_CONTAINER(page_), - GtkUtil::kContentAreaBorder); + gtk_util::kContentAreaBorder); gtk_box_pack_end(GTK_BOX(page_), buttons, FALSE, FALSE, 0); gtk_box_pack_end(GTK_BOX(page_), scroll_window, TRUE, TRUE, 0); } @@ -178,7 +178,7 @@ void PasswordsPageGtk::OnRemoveButtonClicked(GtkButton* widget, GtkTreePath* path = gtk_tree_model_get_path( GTK_TREE_MODEL(page->password_list_sort_), &iter); - gint index = GtkTreeUtil::GetTreeSortChildRowNumForPath( + gint index = gtk_tree_util::GetTreeSortChildRowNumForPath( page->password_list_sort_, path); gtk_tree_path_free(path); @@ -260,7 +260,7 @@ void PasswordsPageGtk::OnShowPasswordButtonClicked(GtkButton* widget, } GtkTreePath* path = gtk_tree_model_get_path( GTK_TREE_MODEL(page->password_list_sort_), &iter); - gint index = GtkTreeUtil::GetTreeSortChildRowNumForPath( + gint index = gtk_tree_util::GetTreeSortChildRowNumForPath( page->password_list_sort_, path); gtk_tree_path_free(path); std::string pass = WideToUTF8(page->password_list_[index].password_value); @@ -292,8 +292,8 @@ void PasswordsPageGtk::OnPasswordSelectionChanged(GtkTreeSelection* selection, gint PasswordsPageGtk::CompareSite(GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b, gpointer window) { - int row1 = GtkTreeUtil::GetRowNumForIter(model, a); - int row2 = GtkTreeUtil::GetRowNumForIter(model, b); + int row1 = gtk_tree_util::GetRowNumForIter(model, a); + int row2 = gtk_tree_util::GetRowNumForIter(model, b); PasswordsPageGtk* page = reinterpret_cast<PasswordsPageGtk*>(window); return page->password_list_[row1].origin.spec().compare( page->password_list_[row2].origin.spec()); @@ -303,8 +303,8 @@ gint PasswordsPageGtk::CompareSite(GtkTreeModel* model, gint PasswordsPageGtk::CompareUsername(GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b, gpointer window) { - int row1 = GtkTreeUtil::GetRowNumForIter(model, a); - int row2 = GtkTreeUtil::GetRowNumForIter(model, b); + int row1 = gtk_tree_util::GetRowNumForIter(model, a); + int row2 = gtk_tree_util::GetRowNumForIter(model, b); PasswordsPageGtk* page = reinterpret_cast<PasswordsPageGtk*>(window); return page->password_list_[row1].username_value.compare( page->password_list_[row2].username_value); diff --git a/chrome/browser/gtk/options/url_picker_dialog_gtk.cc b/chrome/browser/gtk/options/url_picker_dialog_gtk.cc index 786ce0d..94882b1 100644 --- a/chrome/browser/gtk/options/url_picker_dialog_gtk.cc +++ b/chrome/browser/gtk/options/url_picker_dialog_gtk.cc @@ -60,10 +60,10 @@ UrlPickerDialogGtk::UrlPickerDialogGtk(UrlPickerCallback* callback, gtk_window_set_default_size(GTK_WINDOW(dialog_), kDialogDefaultWidth, kDialogDefaultHeight); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), - GtkUtil::kContentAreaSpacing); + gtk_util::kContentAreaSpacing); // URL entry. - GtkWidget* url_hbox = gtk_hbox_new(FALSE, GtkUtil::kLabelSpacing); + GtkWidget* url_hbox = gtk_hbox_new(FALSE, gtk_util::kLabelSpacing); GtkWidget* url_label = gtk_label_new( l10n_util::GetStringUTF8(IDS_ASI_URL).c_str()); gtk_box_pack_start(GTK_BOX(url_hbox), url_label, @@ -78,7 +78,7 @@ UrlPickerDialogGtk::UrlPickerDialogGtk(UrlPickerCallback* callback, FALSE, FALSE, 0); // Recent history description label. - GtkWidget* history_vbox = gtk_vbox_new(FALSE, GtkUtil::kLabelSpacing); + GtkWidget* history_vbox = gtk_vbox_new(FALSE, gtk_util::kLabelSpacing); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog_)->vbox), history_vbox); GtkWidget* history_label = gtk_label_new(NULL); char* markup = g_markup_printf_escaped(kHistoryLabelMarkup, @@ -177,8 +177,8 @@ void UrlPickerDialogGtk::EnableControls() { } std::string UrlPickerDialogGtk::GetURLForPath(GtkTreePath* path) const { - gint row = GtkTreeUtil::GetTreeSortChildRowNumForPath(history_list_sort_, - path); + gint row = gtk_tree_util::GetTreeSortChildRowNumForPath(history_list_sort_, + path); if (row < 0) { NOTREACHED(); return std::string(); @@ -253,8 +253,8 @@ gint UrlPickerDialogGtk::CompareTitle(GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b, gpointer window) { - int row1 = GtkTreeUtil::GetRowNumForIter(model, a); - int row2 = GtkTreeUtil::GetRowNumForIter(model, b); + int row1 = gtk_tree_util::GetRowNumForIter(model, a); + int row2 = gtk_tree_util::GetRowNumForIter(model, b); return reinterpret_cast<UrlPickerDialogGtk*>(window)->url_table_model_-> CompareValues(row1, row2, IDS_ASI_PAGE_COLUMN); } @@ -264,8 +264,8 @@ gint UrlPickerDialogGtk::CompareURL(GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b, gpointer window) { - int row1 = GtkTreeUtil::GetRowNumForIter(model, a); - int row2 = GtkTreeUtil::GetRowNumForIter(model, b); + int row1 = gtk_tree_util::GetRowNumForIter(model, a); + int row2 = gtk_tree_util::GetRowNumForIter(model, b); return reinterpret_cast<UrlPickerDialogGtk*>(window)->url_table_model_-> CompareValues(row1, row2, IDS_ASI_URL_COLUMN); } diff --git a/chrome/browser/gtk/page_info_window_gtk.cc b/chrome/browser/gtk/page_info_window_gtk.cc index 68b05b2f..3a6ec47 100644 --- a/chrome/browser/gtk/page_info_window_gtk.cc +++ b/chrome/browser/gtk/page_info_window_gtk.cc @@ -83,8 +83,8 @@ PageInfoWindowGtk::PageInfoWindowGtk(gfx::NativeWindow parent, NULL); gtk_window_set_default_size(GTK_WINDOW(dialog_), 500, -1); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), - GtkUtil::kContentAreaSpacing); - GtkUtil::SetWindowIcon(GTK_WINDOW(dialog_)); + gtk_util::kContentAreaSpacing); + gtk_util::SetWindowIcon(GTK_WINDOW(dialog_)); g_signal_connect(dialog_, "response", G_CALLBACK(OnDialogResponse), NULL); g_signal_connect(dialog_, "destroy", G_CALLBACK(OnDestroy), this); @@ -99,7 +99,7 @@ void PageInfoWindowGtk::ModelChanged() { GtkWidget* PageInfoWindowGtk::CreateSection( const PageInfoModel::SectionInfo& section) { - GtkWidget* vbox = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); GtkWidget* label = gtk_label_new(UTF16ToUTF8(section.title).c_str()); PangoAttrList* attributes = pango_attr_list_new(); @@ -116,10 +116,10 @@ GtkWidget* PageInfoWindowGtk::CreateSection( rb.GetPixbufNamed(IDR_PAGEINFO_GOOD) : rb.GetPixbufNamed(IDR_PAGEINFO_BAD)); gtk_box_pack_start(GTK_BOX(section_box), image, FALSE, FALSE, - GtkUtil::kControlSpacing); + gtk_util::kControlSpacing); gtk_misc_set_alignment(GTK_MISC(image), 0, 0); - GtkWidget* text_box = gtk_vbox_new(FALSE, GtkUtil::kControlSpacing); + GtkWidget* text_box = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); if (!section.head_line.empty()) { label = gtk_label_new(UTF16ToUTF8(section.head_line).c_str()); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); @@ -139,7 +139,7 @@ GtkWidget* PageInfoWindowGtk::CreateSection( void PageInfoWindowGtk::InitContents() { if (contents_) gtk_widget_destroy(contents_); - contents_ = gtk_vbox_new(FALSE, GtkUtil::kContentAreaSpacing); + contents_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaSpacing); for (int i = 0; i < model_.GetSectionCount(); i++) { gtk_box_pack_start(GTK_BOX(contents_), CreateSection(model_.GetSectionInfo(i)), diff --git a/chrome/browser/gtk/status_bubble_gtk.cc b/chrome/browser/gtk/status_bubble_gtk.cc index 492d279..fb5fcc3 100644 --- a/chrome/browser/gtk/status_bubble_gtk.cc +++ b/chrome/browser/gtk/status_bubble_gtk.cc @@ -144,7 +144,7 @@ void StatusBubbleGtk::InitWidgets() { bg_box_ = gtk_event_box_new(); gtk_container_add(GTK_CONTAINER(bg_box_), padding); - container_.Own(GtkUtil::CreateGtkBorderBin(bg_box_, &kFrameBorderColor, + container_.Own(gtk_util::CreateGtkBorderBin(bg_box_, &kFrameBorderColor, kBorderPadding, kBorderPadding, kBorderPadding, kBorderPadding)); gtk_widget_set_name(container_.get(), "status-bubble"); gtk_widget_set_app_paintable(container_.get(), TRUE); diff --git a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc index 6da76e8..ae12223 100644 --- a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc +++ b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc @@ -386,7 +386,7 @@ void DraggedTabControllerGtk::AdjustDragPointForPinnedTabs( // be pinned. Make sure the dragged tab does not go before the first // non-pinned tab. gfx::Rect tabstrip_bounds = - GtkUtil::GetWidgetScreenBounds(attached_tabstrip_->tabstrip_.get()); + gtk_util::GetWidgetScreenBounds(attached_tabstrip_->tabstrip_.get()); dragged_tab_point->set_x(std::max(dragged_tab_point->x(), tabstrip_bounds.x() + tab_bounds.x())); } @@ -432,7 +432,7 @@ TabStripGtk* DraggedTabControllerGtk::GetTabStripIfItContains( // Make sure the specified screen point is actually within the bounds of the // specified tabstrip... gfx::Rect tabstrip_bounds = - GtkUtil::GetWidgetScreenBounds(tabstrip->tabstrip_.get()); + gtk_util::GetWidgetScreenBounds(tabstrip->tabstrip_.get()); if (screen_point.x() < tabstrip_bounds.right() && screen_point.x() >= tabstrip_bounds.x()) { // TODO(beng): make this be relative to the start position of the mouse for @@ -643,7 +643,7 @@ gfx::Point DraggedTabControllerGtk::GetDraggedTabPoint( // If we're not attached, we just use x and y from above. if (attached_tabstrip_) { gfx::Rect tabstrip_bounds = - GtkUtil::GetWidgetScreenBounds(attached_tabstrip_->tabstrip_.get()); + gtk_util::GetWidgetScreenBounds(attached_tabstrip_->tabstrip_.get()); // Snap the dragged tab to the tabstrip if we are attached, detaching // only when the mouse position (screen_point) exceeds the screen bounds // of the tabstrip. @@ -835,7 +835,7 @@ gfx::Rect DraggedTabControllerGtk::GetTabScreenBounds(TabGtk* tab) { gfx::Rect bounds = tab->GetRequisition(); GtkWidget* widget = tab->widget(); GtkWidget* parent = gtk_widget_get_parent(widget); - gfx::Point point = GtkUtil::GetWidgetScreenPosition(parent); + gfx::Point point = gtk_util::GetWidgetScreenPosition(parent); bounds.Offset(point); return gfx::Rect(bounds.x(), bounds.y(), bounds.width(), bounds.height()); diff --git a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc index 09b1192..2ddb607 100644 --- a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc +++ b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc @@ -87,7 +87,7 @@ void DraggedTabGtk::Attach(int selected_width) { attached_ = true; Resize(selected_width); - if (GtkUtil::IsScreenComposited()) + if (gtk_util::IsScreenComposited()) gdk_window_set_opacity(container_->window, kOpaqueAlpha); } @@ -118,7 +118,7 @@ void DraggedTabGtk::Detach(GtkWidget* contents, BackingStore* backing_store) { backing_store_ = backing_store; ResizeContainer(); - if (GtkUtil::IsScreenComposited()) + if (gtk_util::IsScreenComposited()) gdk_window_set_opacity(container_->window, kTransparentAlpha); } @@ -288,7 +288,7 @@ gboolean DraggedTabGtk::OnExposeEvent(GtkWidget* widget, GdkEventExpose* event, DraggedTabGtk* dragged_tab) { GdkPixbuf* pixbuf = dragged_tab->PaintTab(); - if (GtkUtil::IsScreenComposited()) { + if (gtk_util::IsScreenComposited()) { dragged_tab->SetContainerTransparency(); } else { dragged_tab->SetContainerShapeMask(pixbuf); diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc index d21a9fe..0fa5d39 100644 --- a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc @@ -65,8 +65,8 @@ SkBitmap* crashed_fav_icon = NULL; // Gets the bounds of |widget| relative to |parent|. gfx::Rect GetWidgetBoundsRelativeToParent(GtkWidget* parent, GtkWidget* widget) { - gfx::Point parent_pos = GtkUtil::GetWidgetScreenPosition(parent); - gfx::Point widget_pos = GtkUtil::GetWidgetScreenPosition(widget); + gfx::Point parent_pos = gtk_util::GetWidgetScreenPosition(parent); + gfx::Point widget_pos = gtk_util::GetWidgetScreenPosition(widget); return gfx::Rect(widget_pos.x() - parent_pos.x(), widget_pos.y() - parent_pos.y(), widget->allocation.width, widget->allocation.height); @@ -389,7 +389,7 @@ gfx::Rect TabRendererGtk::GetNonMirroredBounds(GtkWidget* parent) const { // is relative to the browser titlebar. We need the bounds relative to the // tabstrip. gfx::Rect bounds = GetWidgetBoundsRelativeToParent(parent, widget()); - bounds.set_x(GtkUtil::MirroredLeftPointForRect(parent, bounds)); + bounds.set_x(gtk_util::MirroredLeftPointForRect(parent, bounds)); return bounds; } @@ -567,11 +567,11 @@ void TabRendererGtk::Layout() { } favicon_bounds_.set_x( - GtkUtil::MirroredLeftPointForRect(tab_.get(), favicon_bounds_)); + gtk_util::MirroredLeftPointForRect(tab_.get(), favicon_bounds_)); close_button_bounds_.set_x( - GtkUtil::MirroredLeftPointForRect(tab_.get(), close_button_bounds_)); + gtk_util::MirroredLeftPointForRect(tab_.get(), close_button_bounds_)); title_bounds_.set_x( - GtkUtil::MirroredLeftPointForRect(tab_.get(), title_bounds_)); + gtk_util::MirroredLeftPointForRect(tab_.get(), title_bounds_)); MoveCloseButtonWidget(); } diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc index 69a8a74..3af798a 100644 --- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc @@ -1248,7 +1248,7 @@ void TabStripGtk::LayoutNewTabButton(double last_tab_right, } else { bounds.set_x(Round(last_tab_right - kTabHOffset) + kNewTabButtonHOffset); } - bounds.set_x(GtkUtil::MirroredLeftPointForRect(tabstrip_.get(), bounds)); + bounds.set_x(gtk_util::MirroredLeftPointForRect(tabstrip_.get(), bounds)); gtk_fixed_move(GTK_FIXED(tabstrip_.get()), newtab_button_->widget(), bounds.x(), bounds.y()); @@ -1390,7 +1390,7 @@ void TabStripGtk::ResizeLayoutTabs() { bool TabStripGtk::IsCursorInTabStripZone() const { gfx::Point tabstrip_topleft; - GtkUtil::ConvertWidgetPointToScreen(tabstrip_.get(), &tabstrip_topleft); + gtk_util::ConvertWidgetPointToScreen(tabstrip_.get(), &tabstrip_topleft); gfx::Rect bds = bounds(); bds.set_origin(tabstrip_topleft); @@ -1438,12 +1438,12 @@ gfx::Rect TabStripGtk::GetDropBounds(int drop_index, center_x = bounds.x() + bounds.width() + (kTabHOffset / 2); } - center_x = GtkUtil::MirroredXCoordinate(tabstrip_.get(), center_x); + center_x = gtk_util::MirroredXCoordinate(tabstrip_.get(), center_x); // Determine the screen bounds. gfx::Point drop_loc(center_x - drop_indicator_width / 2, -drop_indicator_height); - GtkUtil::ConvertWidgetPointToScreen(tabstrip_.get(), &drop_loc); + gtk_util::ConvertWidgetPointToScreen(tabstrip_.get(), &drop_loc); gfx::Rect drop_bounds(drop_loc.x(), drop_loc.y(), drop_indicator_width, drop_indicator_height); @@ -1460,7 +1460,7 @@ void TabStripGtk::UpdateDropIndex(GdkDragContext* context, gint x, gint y) { // If the UI layout is right-to-left, we need to mirror the mouse // coordinates since we calculate the drop index based on the // original (and therefore non-mirrored) positions of the tabs. - x = GtkUtil::MirroredXCoordinate(tabstrip_.get(), x); + x = gtk_util::MirroredXCoordinate(tabstrip_.get(), x); for (int i = 0; i < GetTabCount(); ++i) { TabGtk* tab = GetTabAt(i); gfx::Rect bounds = tab->GetNonMirroredBounds(tabstrip_.get()); @@ -1565,7 +1565,7 @@ TabStripGtk::DropInfo::~DropInfo() { gboolean TabStripGtk::DropInfo::OnExposeEvent(GtkWidget* widget, GdkEventExpose* event, DropInfo* drop_info) { - if (GtkUtil::IsScreenComposited()) { + if (gtk_util::IsScreenComposited()) { drop_info->SetContainerTransparency(); } else { drop_info->SetContainerShapeMask(); @@ -1892,7 +1892,7 @@ void TabStripGtk::OnNewTabClicked(GtkWidget* widget, TabStripGtk* tabstrip) { void TabStripGtk::SetTabBounds(TabGtk* tab, const gfx::Rect& bounds) { gfx::Rect bds = bounds; - bds.set_x(GtkUtil::MirroredLeftPointForRect(tabstrip_.get(), bounds)); + bds.set_x(gtk_util::MirroredLeftPointForRect(tabstrip_.get(), bounds)); tab->SetBounds(bds); gtk_fixed_move(GTK_FIXED(tabstrip_.get()), tab->widget(), bds.x(), bds.y()); diff --git a/chrome/browser/gtk/task_manager_gtk.cc b/chrome/browser/gtk/task_manager_gtk.cc index 34cae0f..f1cb25b 100644 --- a/chrome/browser/gtk/task_manager_gtk.cc +++ b/chrome/browser/gtk/task_manager_gtk.cc @@ -338,8 +338,8 @@ void TaskManagerGtk::Init() { ConnectAccelerators(); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), - GtkUtil::kContentAreaSpacing); - GtkUtil::SetWindowIcon(GTK_WINDOW(dialog_)); + gtk_util::kContentAreaSpacing); + gtk_util::SetWindowIcon(GTK_WINDOW(dialog_)); g_signal_connect(G_OBJECT(dialog_), "response", G_CALLBACK(OnResponse), this); g_signal_connect(G_OBJECT(dialog_), "button-release-event", @@ -635,7 +635,7 @@ gboolean TaskManagerGtk::OnButtonReleaseEvent(GtkWidget* widget, GdkEventButton* event, TaskManagerGtk* task_manager) { // We don't want to open the context menu in the treeview. - if (GtkUtil::WidgetContainsCursor(task_manager->treeview_)) + if (gtk_util::WidgetContainsCursor(task_manager->treeview_)) return FALSE; if (event->button == 3) diff --git a/chrome/browser/login_prompt_gtk.cc b/chrome/browser/login_prompt_gtk.cc index 416378b..ef98d26 100644 --- a/chrome/browser/login_prompt_gtk.cc +++ b/chrome/browser/login_prompt_gtk.cc @@ -58,7 +58,7 @@ class LoginHandlerGtk : public LoginHandler, std::wstring explanation) { DCHECK(MessageLoop::current() == ui_loop_); - root_.Own(gtk_vbox_new(NULL, GtkUtil::kContentAreaBorder)); + root_.Own(gtk_vbox_new(NULL, gtk_util::kContentAreaBorder)); GtkWidget* label = gtk_label_new(WideToUTF8(explanation).c_str()); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_box_pack_start(GTK_BOX(root_.get()), label, FALSE, FALSE, 0); @@ -70,7 +70,7 @@ class LoginHandlerGtk : public LoginHandler, gtk_entry_set_activates_default(GTK_ENTRY(password_entry_), TRUE); gtk_entry_set_visibility(GTK_ENTRY(password_entry_), FALSE); - GtkWidget* table = GtkUtil::CreateLabeledControlsGroup(NULL, + GtkWidget* table = gtk_util::CreateLabeledControlsGroup(NULL, l10n_util::GetStringUTF8(IDS_LOGIN_DIALOG_USERNAME_FIELD).c_str(), username_entry_, l10n_util::GetStringUTF8(IDS_LOGIN_DIALOG_PASSWORD_FIELD).c_str(), diff --git a/chrome/common/gtk_tree_util.cc b/chrome/common/gtk_tree_util.cc index bc4ed021..0b4cec4 100644 --- a/chrome/common/gtk_tree_util.cc +++ b/chrome/common/gtk_tree_util.cc @@ -6,8 +6,9 @@ #include "base/logging.h" -// static -gint GtkTreeUtil::GetRowNumForPath(GtkTreePath* path) { +namespace gtk_tree_util { + +gint GetRowNumForPath(GtkTreePath* path) { gint* indices = gtk_tree_path_get_indices(path); if (!indices) { NOTREACHED(); @@ -16,20 +17,20 @@ gint GtkTreeUtil::GetRowNumForPath(GtkTreePath* path) { return indices[0]; } -// static -gint GtkTreeUtil::GetRowNumForIter(GtkTreeModel* model, GtkTreeIter* iter) { +gint GetRowNumForIter(GtkTreeModel* model, GtkTreeIter* iter) { GtkTreePath* path = gtk_tree_model_get_path(model, iter); int row = GetRowNumForPath(path); gtk_tree_path_free(path); return row; } -// static -gint GtkTreeUtil::GetTreeSortChildRowNumForPath(GtkTreeModel* sort_model, - GtkTreePath* sort_path) { +gint GetTreeSortChildRowNumForPath(GtkTreeModel* sort_model, + GtkTreePath* sort_path) { GtkTreePath *child_path = gtk_tree_model_sort_convert_path_to_child_path( GTK_TREE_MODEL_SORT(sort_model), sort_path); int row = GetRowNumForPath(child_path); gtk_tree_path_free(child_path); return row; } + +} // namespace gtk_tree_util diff --git a/chrome/common/gtk_tree_util.h b/chrome/common/gtk_tree_util.h index abd9ee6..63f4644 100644 --- a/chrome/common/gtk_tree_util.h +++ b/chrome/common/gtk_tree_util.h @@ -7,23 +7,19 @@ #include <gtk/gtk.h> -#include "base/basictypes.h" +namespace gtk_tree_util { -class GtkTreeUtil { - public: - // Get the row number corresponding to |path|. - static gint GetRowNumForPath(GtkTreePath* path); +// Get the row number corresponding to |path|. +gint GetRowNumForPath(GtkTreePath* path); - // Get the row number corresponding to |iter|. - static gint GetRowNumForIter(GtkTreeModel* model, GtkTreeIter* iter); +// Get the row number corresponding to |iter|. +gint GetRowNumForIter(GtkTreeModel* model, GtkTreeIter* iter); - // Get the row number in the child tree model corresponding to |sort_path| in - // the parent tree model. - static gint GetTreeSortChildRowNumForPath(GtkTreeModel* sort_model, - GtkTreePath* sort_path); +// Get the row number in the child tree model corresponding to |sort_path| in +// the parent tree model. +gint GetTreeSortChildRowNumForPath(GtkTreeModel* sort_model, + GtkTreePath* sort_path); - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(GtkTreeUtil); -}; +} // namespace gtk_tree_util #endif // CHROME_COMMON_GTK_TREE_UTIL_H_ diff --git a/chrome/common/gtk_util.cc b/chrome/common/gtk_util.cc index 29d63f2..19eb595b 100644 --- a/chrome/common/gtk_util.cc +++ b/chrome/common/gtk_util.cc @@ -138,8 +138,10 @@ guint32 GetGdkEventTime(GdkEvent* event) { } // namespace event_utils -GtkWidget* GtkUtil::CreateLabeledControlsGroup(std::vector<GtkWidget*>* labels, - const char* text, ...) { +namespace gtk_util { + +GtkWidget* CreateLabeledControlsGroup(std::vector<GtkWidget*>* labels, + const char* text, ...) { va_list ap; va_start(ap, text); GtkWidget* table = gtk_table_new(0, 2, FALSE); @@ -167,9 +169,8 @@ GtkWidget* GtkUtil::CreateLabeledControlsGroup(std::vector<GtkWidget*>* labels, return table; } -GtkWidget* GtkUtil::CreateGtkBorderBin(GtkWidget* child, const GdkColor* color, - int top, int bottom, - int left, int right) { +GtkWidget* CreateGtkBorderBin(GtkWidget* child, const GdkColor* color, + int top, int bottom, int left, int right) { // Use a GtkEventBox to get the background painted. However, we can't just // use a container border, since it won't paint there. Use an alignment // inside to get the sizes exactly of how we want the border painted. @@ -183,9 +184,8 @@ GtkWidget* GtkUtil::CreateGtkBorderBin(GtkWidget* child, const GdkColor* color, return ebox; } -bool GtkUtil::GetWidgetSizeFromResources(GtkWidget* widget, - int width_chars, int height_lines, - int* width, int* height) { +bool GetWidgetSizeFromResources(GtkWidget* widget, int width_chars, + int height_lines, int* width, int* height) { PangoContext* context = gtk_widget_create_pango_context(widget); PangoFontMetrics* metrics = pango_context_get_metrics(context, widget->style->font_desc, pango_context_get_language(context)); @@ -205,11 +205,11 @@ bool GtkUtil::GetWidgetSizeFromResources(GtkWidget* widget, return true; } -void GtkUtil::RemoveAllChildren(GtkWidget* container) { +void RemoveAllChildren(GtkWidget* container) { gtk_container_foreach(GTK_CONTAINER(container), RemoveWidget, container); } -void GtkUtil::ForceFontSizePixels(GtkWidget* widget, double size_pixels) { +void ForceFontSizePixels(GtkWidget* widget, double size_pixels) { GtkStyle* style = widget->style; PangoFontDescription* font_desc = style->font_desc; // pango_font_description_set_absolute_size sets the font size in device @@ -219,7 +219,7 @@ void GtkUtil::ForceFontSizePixels(GtkWidget* widget, double size_pixels) { gtk_widget_modify_font(widget, font_desc); } -gfx::Point GtkUtil::GetWidgetScreenPosition(GtkWidget* widget) { +gfx::Point GetWidgetScreenPosition(GtkWidget* widget) { int x = 0, y = 0; if (GTK_IS_WINDOW(widget)) { @@ -252,13 +252,13 @@ gfx::Point GtkUtil::GetWidgetScreenPosition(GtkWidget* widget) { return gfx::Point(x, y); } -gfx::Rect GtkUtil::GetWidgetScreenBounds(GtkWidget* widget) { +gfx::Rect GetWidgetScreenBounds(GtkWidget* widget) { gfx::Point position = GetWidgetScreenPosition(widget); return gfx::Rect(position.x(), position.y(), widget->allocation.width, widget->allocation.height); } -void GtkUtil::ConvertWidgetPointToScreen(GtkWidget* widget, gfx::Point* p) { +void ConvertWidgetPointToScreen(GtkWidget* widget, gfx::Point* p) { DCHECK(widget); DCHECK(p); @@ -266,7 +266,7 @@ void GtkUtil::ConvertWidgetPointToScreen(GtkWidget* widget, gfx::Point* p) { p->SetPoint(p->x() + position.x(), p->y() + position.y()); } -void GtkUtil::InitRCStyles() { +void InitRCStyles() { static const char kRCText[] = // Make our dialogs styled like the GNOME HIG. // @@ -295,8 +295,8 @@ void GtkUtil::InitRCStyles() { gtk_rc_parse_string(kRCText); } -void GtkUtil::CenterWidgetInHBox(GtkWidget* hbox, GtkWidget* widget, - bool pack_at_end, int padding) { +void CenterWidgetInHBox(GtkWidget* hbox, GtkWidget* widget, bool pack_at_end, + int padding) { GtkWidget* centering_vbox = gtk_vbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(centering_vbox), widget, TRUE, FALSE, 0); if (pack_at_end) @@ -305,8 +305,7 @@ void GtkUtil::CenterWidgetInHBox(GtkWidget* hbox, GtkWidget* widget, gtk_box_pack_start(GTK_BOX(hbox), centering_vbox, FALSE, FALSE, padding); } -std::string GtkUtil::ConvertAcceleratorsFromWindowsStyle( - const std::string& label) { +std::string ConvertAcceleratorsFromWindowsStyle(const std::string& label) { std::string ret; ret.reserve(label.length()); for (size_t i = 0; i < label.length(); ++i) { @@ -325,13 +324,12 @@ std::string GtkUtil::ConvertAcceleratorsFromWindowsStyle( return ret; } -bool GtkUtil::IsScreenComposited() { +bool IsScreenComposited() { GdkScreen* screen = gdk_screen_get_default(); return gdk_screen_is_composited(screen) == TRUE; } -void GtkUtil::EnumerateTopLevelWindows( - x11_util::EnumerateWindowsDelegate* delegate) { +void EnumerateTopLevelWindows(x11_util::EnumerateWindowsDelegate* delegate) { GdkScreen* screen = gdk_screen_get_default(); GList* stack = gdk_screen_get_window_stack(screen); if (!stack) { @@ -358,7 +356,7 @@ void GtkUtil::EnumerateTopLevelWindows( g_list_free(stack); } -void GtkUtil::SetButtonTriggersNavigation(GtkWidget* button) { +void SetButtonTriggersNavigation(GtkWidget* button) { // We handle button activation manually because we want to accept middle mouse // clicks. g_signal_connect(G_OBJECT(button), "button-press-event", @@ -367,22 +365,21 @@ void GtkUtil::SetButtonTriggersNavigation(GtkWidget* button) { G_CALLBACK(OnMouseButtonReleased), NULL); } -int GtkUtil::MirroredLeftPointForRect(GtkWidget* widget, - const gfx::Rect& bounds) { +int MirroredLeftPointForRect(GtkWidget* widget, const gfx::Rect& bounds) { if (l10n_util::GetTextDirection() != l10n_util::RIGHT_TO_LEFT) { return bounds.x(); } return widget->allocation.width - bounds.x() - bounds.width(); } -int GtkUtil::MirroredXCoordinate(GtkWidget* widget, int x) { +int MirroredXCoordinate(GtkWidget* widget, int x) { if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) { return widget->allocation.width - x; } return x; } -bool GtkUtil::WidgetContainsCursor(GtkWidget* widget) { +bool WidgetContainsCursor(GtkWidget* widget) { gint x = 0; gint y = 0; gtk_widget_get_pointer(widget, &x, &y); @@ -400,7 +397,7 @@ bool GtkUtil::WidgetContainsCursor(GtkWidget* widget) { return widget_allocation.Contains(x, y); } -void GtkUtil::SetWindowIcon(GtkWindow* window) { +void SetWindowIcon(GtkWindow* window) { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); GList* icon_list = NULL; icon_list = g_list_append(icon_list, rb.GetPixbufNamed(IDR_PRODUCT_ICON_32)); @@ -408,3 +405,5 @@ void GtkUtil::SetWindowIcon(GtkWindow* window) { gtk_window_set_icon_list(window, icon_list); g_list_free(icon_list); } + +} // namespace gtk_util diff --git a/chrome/common/gtk_util.h b/chrome/common/gtk_util.h index 0737016..399cb42 100644 --- a/chrome/common/gtk_util.h +++ b/chrome/common/gtk_util.h @@ -9,7 +9,6 @@ #include <string> #include <vector> -#include "base/basictypes.h" #include "base/gfx/point.h" #include "base/gfx/rect.h" #include "chrome/common/x11_util.h" @@ -31,115 +30,109 @@ guint32 GetGdkEventTime(GdkEvent* event); } // namespace event_utils -class GtkUtil { - public: - // Constants relating to the layout of dialog windows: - // (See http://library.gnome.org/devel/hig-book/stable/design-window.html.en) - - // Spacing between controls of the same group. - static const int kControlSpacing = 6; - - // Horizontal spacing between a label and its control. - static const int kLabelSpacing = 12; - - // Indent of the controls within each group. - static const int kGroupIndent = 12; - - // Space around the outsides of a dialog's contents. - static const int kContentAreaBorder = 12; - - // Spacing between groups of controls. - static const int kContentAreaSpacing = 18; - - // Create a table of labeled controls, using proper spacing and alignment. - // Arguments should be pairs of const char*, GtkWidget*, concluding with a - // NULL. The first argument is a vector in which to place all labels - // produced. It can be NULL if you don't need to keep track of the label - // widgets. The second argument is a color to force the label text to. It can - // be NULL to get the system default. - // - // For example: - // controls = CreateLabeledControlsGroup(NULL, &gfx::kGdkBlack, - // "Name:", title_entry_, - // "Folder:", folder_combobox_, - // NULL); - static GtkWidget* CreateLabeledControlsGroup(std::vector<GtkWidget*>* labels, - const char* text, ...); - - // Create a GtkBin with |child| as its child widget. This bin will paint a - // border of color |color| with the sizes specified in pixels. - static GtkWidget* CreateGtkBorderBin(GtkWidget* child, const GdkColor* color, - int top, int bottom, - int left, int right); - - // Calculates the size of given widget based on the size specified in - // number of characters/lines (in locale specific resource file) and - // font metrics. - static bool GetWidgetSizeFromResources(GtkWidget* widget, - int width_chars, int height_lines, - int* width, int* height); - - // Remove all children from this container. - static void RemoveAllChildren(GtkWidget* container); - - // Force the font size of the widget to |size_pixels|. - static void ForceFontSizePixels(GtkWidget* widget, double size_pixels); - - // Gets the position of a gtk widget in screen coordinates. - static gfx::Point GetWidgetScreenPosition(GtkWidget* widget); - - // Returns the bounds of the specified widget in screen coordinates. - static gfx::Rect GetWidgetScreenBounds(GtkWidget* widget); - - // Converts a point in a widget to screen coordinates. The point |p| is - // relative to the widget's top-left origin. - static void ConvertWidgetPointToScreen(GtkWidget* widget, gfx::Point* p); - - // Initialize some GTK settings so that our dialogs are consistent. - static void InitRCStyles(); - - // Stick the widget in the given hbox without expanding vertically. The widget - // is packed at the start of the hbox. This is useful for widgets that would - // otherwise expand to fill the vertical space of the hbox (e.g. buttons). - static void CenterWidgetInHBox(GtkWidget* hbox, GtkWidget* widget, - bool pack_at_end, int padding); - - // Change windows accelerator style to GTK style. (GTK uses _ for - // accelerators. Windows uses & with && as an escape for &.) - static std::string ConvertAcceleratorsFromWindowsStyle( - const std::string& label); - - // Returns true if the screen is composited, false otherwise. - static bool IsScreenComposited(); - - // Enumerates the top-level gdk windows of the current display. - static void EnumerateTopLevelWindows( - x11_util::EnumerateWindowsDelegate* delegate); - - // Set that a button causes a page navigation. In particular, it will accept - // middle clicks. Warning: only call this *after* you have connected your - // own handlers for button-press and button-release events, or you will not - // get those events. - static void SetButtonTriggersNavigation(GtkWidget* button); - - // Returns the mirrored x value for |bounds| if the layout is RTL; otherwise, - // the original value is returned unchanged. - static int MirroredLeftPointForRect(GtkWidget* widget, - const gfx::Rect& bounds); - - // Returns the mirrored x value for the point |x| if the layout is RTL; - // otherwise, the original value is returned unchanged. - static int MirroredXCoordinate(GtkWidget* widget, int x); - - // Returns true if the pointer is currently inside the widget. - static bool WidgetContainsCursor(GtkWidget* widget); - - // Sets the icon of |window| to the product icon (potentially used in window - // border or alt-tab list). - static void SetWindowIcon(GtkWindow* window); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(GtkUtil); -}; +namespace gtk_util { + +// Constants relating to the layout of dialog windows: +// (See http://library.gnome.org/devel/hig-book/stable/design-window.html.en) + +// Spacing between controls of the same group. +const int kControlSpacing = 6; + +// Horizontal spacing between a label and its control. +const int kLabelSpacing = 12; + +// Indent of the controls within each group. +const int kGroupIndent = 12; + +// Space around the outsides of a dialog's contents. +const int kContentAreaBorder = 12; + +// Spacing between groups of controls. +const int kContentAreaSpacing = 18; + +// Create a table of labeled controls, using proper spacing and alignment. +// Arguments should be pairs of const char*, GtkWidget*, concluding with a +// NULL. The first argument is a vector in which to place all labels +// produced. It can be NULL if you don't need to keep track of the label +// widgets. The second argument is a color to force the label text to. It can +// be NULL to get the system default. +// +// For example: +// controls = CreateLabeledControlsGroup(NULL, &gfx::kGdkBlack, +// "Name:", title_entry_, +// "Folder:", folder_combobox_, +// NULL); +GtkWidget* CreateLabeledControlsGroup( + std::vector<GtkWidget*>* labels, + const char* text, ...); + +// Create a GtkBin with |child| as its child widget. This bin will paint a +// border of color |color| with the sizes specified in pixels. +GtkWidget* CreateGtkBorderBin(GtkWidget* child, const GdkColor* color, + int top, int bottom, int left, int right); + +// Calculates the size of given widget based on the size specified in +// number of characters/lines (in locale specific resource file) and +// font metrics. +bool GetWidgetSizeFromResources(GtkWidget* widget, int width_chars, + int height_lines, int* width, int* height); + +// Remove all children from this container. +void RemoveAllChildren(GtkWidget* container); + +// Force the font size of the widget to |size_pixels|. +void ForceFontSizePixels(GtkWidget* widget, double size_pixels); + +// Gets the position of a gtk widget in screen coordinates. +gfx::Point GetWidgetScreenPosition(GtkWidget* widget); + +// Returns the bounds of the specified widget in screen coordinates. +gfx::Rect GetWidgetScreenBounds(GtkWidget* widget); + +// Converts a point in a widget to screen coordinates. The point |p| is +// relative to the widget's top-left origin. +void ConvertWidgetPointToScreen(GtkWidget* widget, gfx::Point* p); + +// Initialize some GTK settings so that our dialogs are consistent. +void InitRCStyles(); + +// Stick the widget in the given hbox without expanding vertically. The widget +// is packed at the start of the hbox. This is useful for widgets that would +// otherwise expand to fill the vertical space of the hbox (e.g. buttons). +void CenterWidgetInHBox(GtkWidget* hbox, GtkWidget* widget, bool pack_at_end, + int padding); + +// Change windows accelerator style to GTK style. (GTK uses _ for +// accelerators. Windows uses & with && as an escape for &.) +std::string ConvertAcceleratorsFromWindowsStyle(const std::string& label); + +// Returns true if the screen is composited, false otherwise. +bool IsScreenComposited(); + +// Enumerates the top-level gdk windows of the current display. +void EnumerateTopLevelWindows(x11_util::EnumerateWindowsDelegate* delegate); + +// Set that a button causes a page navigation. In particular, it will accept +// middle clicks. Warning: only call this *after* you have connected your +// own handlers for button-press and button-release events, or you will not get +// those events. +void SetButtonTriggersNavigation(GtkWidget* button); + +// Returns the mirrored x value for |bounds| if the layout is RTL; otherwise, +// the original value is returned unchanged. +int MirroredLeftPointForRect(GtkWidget* widget, const gfx::Rect& bounds); + +// Returns the mirrored x value for the point |x| if the layout is RTL; +// otherwise, the original value is returned unchanged. +int MirroredXCoordinate(GtkWidget* widget, int x); + +// Returns true if the pointer is currently inside the widget. +bool WidgetContainsCursor(GtkWidget* widget); + +// Sets the icon of |window| to the product icon (potentially used in window +// border or alt-tab list). +void SetWindowIcon(GtkWindow* window); + +} // namespace gtk_util #endif // CHROME_COMMON_GTK_UTIL_H_ |