diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-25 20:38:12 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-25 20:38:12 +0000 |
commit | 71c5c3b6906dbca8db3a3de52f459c4d30d036be (patch) | |
tree | 8270d974ccdd5ac7417d38fb684619305fdf82c9 /chrome/browser/ui/gtk | |
parent | 815d5f4e41b1ea064b090efad24d9cf8dca21776 (diff) | |
download | chromium_src-71c5c3b6906dbca8db3a3de52f459c4d30d036be.zip chromium_src-71c5c3b6906dbca8db3a3de52f459c4d30d036be.tar.gz chromium_src-71c5c3b6906dbca8db3a3de52f459c4d30d036be.tar.bz2 |
Revert "content: Start splitting up chrome/browser/ui/gtk/gtk_util.h"
This reverts r98287.
BUG=93804
Review URL: http://codereview.chromium.org/7749017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98290 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/gtk')
46 files changed, 175 insertions, 173 deletions
diff --git a/chrome/browser/ui/gtk/about_chrome_dialog.cc b/chrome/browser/ui/gtk/about_chrome_dialog.cc index 164ea80..61f8406 100644 --- a/chrome/browser/ui/gtk/about_chrome_dialog.cc +++ b/chrome/browser/ui/gtk/about_chrome_dialog.cc @@ -16,6 +16,7 @@ #include "chrome/browser/ui/gtk/cairo_cached_surface.h" #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" #include "chrome/browser/ui/gtk/gtk_theme_service.h" +#include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/url_constants.h" @@ -23,7 +24,6 @@ #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "grit/theme_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image.h" @@ -134,7 +134,7 @@ void ShowAboutDialogForProfile(GtkWindow* parent, Profile* profile) { GtkWidget* text_vbox = gtk_vbox_new(FALSE, kExtraLineSpacing); - GdkColor black = ui::kGdkBlack; + GdkColor black = gtk_util::kGdkBlack; GtkWidget* product_label = MakeMarkupLabel( "<span font_desc=\"18\" style=\"normal\">%s</span>", l10n_util::GetStringUTF8(IDS_PRODUCT_NAME)); @@ -267,8 +267,8 @@ void ShowAboutDialogForProfile(GtkWindow* parent, Profile* profile) { GtkWidget* alignment = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), - ui::kContentAreaBorder, 0, - ui::kContentAreaBorder, ui::kContentAreaBorder); + gtk_util::kContentAreaBorder, 0, + gtk_util::kContentAreaBorder, gtk_util::kContentAreaBorder); gtk_container_add(GTK_CONTAINER(alignment), vbox); gtk_box_pack_start(GTK_BOX(content_area), alignment, FALSE, FALSE, 0); diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc index 157505b..a27505b 100644 --- a/chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc @@ -25,7 +25,6 @@ #include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "grit/generated_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" namespace { @@ -74,7 +73,7 @@ void BookmarkBubbleGtk::Observe(int type, } else { for (std::vector<GtkWidget*>::iterator it = labels_.begin(); it != labels_.end(); ++it) { - gtk_widget_modify_fg(*it, GTK_STATE_NORMAL, &ui::kGdkBlack); + gtk_widget_modify_fg(*it, GTK_STATE_NORMAL, >k_util::kGdkBlack); } } } diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.cc index a28dd79..6b357b1 100644 --- a/chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.cc +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.cc @@ -25,7 +25,6 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/models/simple_menu_model.h" #include "ui/gfx/gtk_util.h" @@ -345,7 +344,7 @@ void BookmarkEditorGtk::Init(GtkWindow* parent_window) { // // * The url and corresponding label are not shown if creating a new folder. GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); - gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); GtkWidget* vbox = gtk_vbox_new(FALSE, 12); diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc index 9d7cc33..90721a1 100644 --- a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc @@ -16,7 +16,6 @@ #include "chrome/browser/ui/gtk/gtk_theme_service.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "ui/base/dragdrop/gtk_dnd_util.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/text/text_elider.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas_skia_paint.h" @@ -281,8 +280,8 @@ void SetButtonTextColors(GtkWidget* label, GtkThemeService* provider) { // Because the prelight state is a white image that doesn't change by the // theme, force the text color to black when it would be used. - gtk_widget_modify_fg(label, GTK_STATE_ACTIVE, &ui::kGdkBlack); - gtk_widget_modify_fg(label, GTK_STATE_PRELIGHT, &ui::kGdkBlack); + gtk_widget_modify_fg(label, GTK_STATE_ACTIVE, >k_util::kGdkBlack); + gtk_widget_modify_fg(label, GTK_STATE_PRELIGHT, >k_util::kGdkBlack); } } diff --git a/chrome/browser/ui/gtk/browser_titlebar.cc b/chrome/browser/ui/gtk/browser_titlebar.cc index 29b826c..051c68e 100644 --- a/chrome/browser/ui/gtk/browser_titlebar.cc +++ b/chrome/browser/ui/gtk/browser_titlebar.cc @@ -46,7 +46,6 @@ #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" #include "grit/ui_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/gtk_util.h" @@ -759,10 +758,10 @@ void BrowserTitlebar::UpdateTextColor() { ThemeService::COLOR_FRAME_INACTIVE); } GdkColor text_color = PickLuminosityContrastingColor( - &frame_color, &ui::kGdkWhite, &ui::kGdkBlack); + &frame_color, >k_util::kGdkWhite, >k_util::kGdkBlack); gtk_util::SetLabelColor(app_mode_title_, &text_color); } else { - gtk_util::SetLabelColor(app_mode_title_, &ui::kGdkWhite); + gtk_util::SetLabelColor(app_mode_title_, >k_util::kGdkWhite); } } diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc index 04da093..9415480 100644 --- a/chrome/browser/ui/gtk/browser_window_gtk.cc +++ b/chrome/browser/ui/gtk/browser_window_gtk.cc @@ -91,7 +91,6 @@ #include "grit/theme_resources_standard.h" #include "grit/ui_resources.h" #include "ui/base/gtk/gtk_floating_container.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/keycodes/keyboard_codes.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/gtk_util.h" @@ -1753,7 +1752,7 @@ void BrowserWindowGtk::InitWidgets() { // Set a white background so during startup the user sees white in the // content area before we get a TabContents in place. gtk_widget_modify_bg(render_area_event_box_, GTK_STATE_NORMAL, - &ui::kGdkWhite); + >k_util::kGdkWhite); gtk_container_add(GTK_CONTAINER(render_area_event_box_), render_area_floating_container_); gtk_widget_show(render_area_event_box_); diff --git a/chrome/browser/ui/gtk/bubble/bubble_gtk.cc b/chrome/browser/ui/gtk/bubble/bubble_gtk.cc index b0eab61..c017d05 100644 --- a/chrome/browser/ui/gtk/bubble/bubble_gtk.cc +++ b/chrome/browser/ui/gtk/bubble/bubble_gtk.cc @@ -12,7 +12,6 @@ #include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/common/chrome_notification_types.h" #include "content/common/notification_service.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/gtk/gtk_windowing.h" #include "ui/gfx/gtk_util.h" #include "ui/gfx/path.h" diff --git a/chrome/browser/ui/gtk/certificate_viewer.cc b/chrome/browser/ui/gtk/certificate_viewer.cc index 7a07793..e062fec 100644 --- a/chrome/browser/ui/gtk/certificate_viewer.cc +++ b/chrome/browser/ui/gtk/certificate_viewer.cc @@ -19,7 +19,6 @@ #include "chrome/common/net/x509_certificate_model.h" #include "grit/generated_resources.h" #include "net/base/x509_certificate.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/gtk_util.h" @@ -149,7 +148,7 @@ CertificateViewer::CertificateViewer( GTK_RESPONSE_CLOSE, NULL); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), - ui::kContentAreaSpacing); + gtk_util::kContentAreaSpacing); x509_certificate_model::RegisterDynamicOids(); InitGeneralPage(); @@ -184,11 +183,11 @@ CertificateViewer::~CertificateViewer() { void CertificateViewer::InitGeneralPage() { net::X509Certificate::OSCertHandle cert = cert_chain_list_.front(); - general_page_vbox_ = gtk_vbox_new(FALSE, ui::kContentAreaSpacing); + general_page_vbox_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaSpacing); gtk_container_set_border_width(GTK_CONTAINER(general_page_vbox_), - ui::kContentAreaBorder); + gtk_util::kContentAreaBorder); - GtkWidget* uses_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* uses_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(general_page_vbox_), uses_vbox, FALSE, FALSE, 0); gtk_box_pack_start( GTK_BOX(uses_vbox), @@ -210,8 +209,8 @@ void CertificateViewer::InitGeneralPage() { const int num_rows = 21; GtkTable* table = GTK_TABLE(gtk_table_new(num_rows, 2, FALSE)); - gtk_table_set_col_spacing(table, 0, ui::kLabelSpacing); - gtk_table_set_row_spacings(table, ui::kControlSpacing); + gtk_table_set_col_spacing(table, 0, gtk_util::kLabelSpacing); + gtk_table_set_row_spacings(table, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(general_page_vbox_), GTK_WIDGET(table), FALSE, FALSE, 0); @@ -525,11 +524,11 @@ GtkTreeStore* CertificateViewer::CreateFieldsTreeStore( } void CertificateViewer::InitDetailsPage() { - details_page_vbox_ = gtk_vbox_new(FALSE, ui::kContentAreaSpacing); + details_page_vbox_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaSpacing); gtk_container_set_border_width(GTK_CONTAINER(details_page_vbox_), - ui::kContentAreaBorder); + gtk_util::kContentAreaBorder); - GtkWidget* hierarchy_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* hierarchy_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(details_page_vbox_), hierarchy_vbox, FALSE, FALSE, 0); @@ -568,7 +567,7 @@ void CertificateViewer::InitDetailsPage() { gtk_box_pack_start(GTK_BOX(hierarchy_vbox), hierarchy_scroll_window, FALSE, FALSE, 0); - GtkWidget* fields_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* fields_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(details_page_vbox_), fields_vbox, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(fields_vbox), @@ -598,7 +597,7 @@ void CertificateViewer::InitDetailsPage() { gtk_box_pack_start(GTK_BOX(fields_vbox), fields_scroll_window, TRUE, TRUE, 0); - GtkWidget* value_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* value_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(details_page_vbox_), value_vbox, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(value_vbox), diff --git a/chrome/browser/ui/gtk/collected_cookies_gtk.cc b/chrome/browser/ui/gtk/collected_cookies_gtk.cc index e73a8a2..3fb3cae 100644 --- a/chrome/browser/ui/gtk/collected_cookies_gtk.cc +++ b/chrome/browser/ui/gtk/collected_cookies_gtk.cc @@ -18,7 +18,6 @@ #include "chrome/common/chrome_notification_types.h" #include "content/common/notification_source.h" #include "grit/generated_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" namespace { @@ -92,8 +91,8 @@ CollectedCookiesGtk::CollectedCookiesGtk(GtkWindow* parent, } void CollectedCookiesGtk::Init() { - dialog_ = gtk_vbox_new(FALSE, ui::kContentAreaSpacing); - gtk_box_set_spacing(GTK_BOX(dialog_), ui::kContentAreaSpacing); + dialog_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(dialog_), gtk_util::kContentAreaSpacing); GtkWidget* label = gtk_label_new( l10n_util::GetStringUTF8(IDS_COLLECTED_COOKIES_DIALOG_TITLE).c_str()); @@ -150,7 +149,7 @@ void CollectedCookiesGtk::Init() { // Close button. GtkWidget* button_box = gtk_hbutton_box_new(); gtk_button_box_set_layout(GTK_BUTTON_BOX(button_box), GTK_BUTTONBOX_END); - gtk_box_set_spacing(GTK_BOX(button_box), ui::kControlSpacing); + gtk_box_set_spacing(GTK_BOX(button_box), gtk_util::kControlSpacing); gtk_box_pack_end(GTK_BOX(dialog_), button_box, FALSE, TRUE, 0); close_button_ = gtk_button_new_from_stock(GTK_STOCK_CLOSE); gtk_button_set_label(GTK_BUTTON(close_button_), @@ -167,14 +166,14 @@ void CollectedCookiesGtk::Init() { } GtkWidget* CollectedCookiesGtk::CreateAllowedPane() { - GtkWidget* cookie_list_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* cookie_list_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); GtkWidget* label = gtk_label_new( l10n_util::GetStringUTF8(IDS_COLLECTED_COOKIES_ALLOWED_COOKIES_LABEL). c_str()); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); gtk_box_pack_start(GTK_BOX(cookie_list_vbox), label, FALSE, FALSE, - ui::kControlSpacing); + gtk_util::kControlSpacing); GtkWidget* scroll_window = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_window), @@ -222,9 +221,9 @@ GtkWidget* CollectedCookiesGtk::CreateAllowedPane() { GtkWidget* button_box = gtk_hbutton_box_new(); gtk_button_box_set_layout(GTK_BUTTON_BOX(button_box), GTK_BUTTONBOX_START); - gtk_box_set_spacing(GTK_BOX(button_box), ui::kControlSpacing); + gtk_box_set_spacing(GTK_BOX(button_box), gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(cookie_list_vbox), button_box, FALSE, FALSE, - ui::kControlSpacing); + gtk_util::kControlSpacing); block_allowed_cookie_button_ = gtk_button_new_with_label( l10n_util::GetStringUTF8(IDS_COLLECTED_COOKIES_BLOCK_BUTTON).c_str()); g_signal_connect(block_allowed_cookie_button_, "clicked", @@ -235,7 +234,7 @@ GtkWidget* CollectedCookiesGtk::CreateAllowedPane() { // horizontal axis. GtkWidget* box = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(box), cookie_list_vbox, TRUE, TRUE, - ui::kControlSpacing); + gtk_util::kControlSpacing); return box; } @@ -245,7 +244,7 @@ GtkWidget* CollectedCookiesGtk::CreateBlockedPane() { HostContentSettingsMap* host_content_settings_map = wrapper->profile()->GetHostContentSettingsMap(); - GtkWidget* cookie_list_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* cookie_list_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); GtkWidget* label = gtk_label_new( l10n_util::GetStringUTF8( @@ -256,7 +255,7 @@ GtkWidget* CollectedCookiesGtk::CreateBlockedPane() { gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); gtk_box_pack_start(GTK_BOX(cookie_list_vbox), label, TRUE, TRUE, - ui::kControlSpacing); + gtk_util::kControlSpacing); GtkWidget* scroll_window = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_window), @@ -302,9 +301,9 @@ GtkWidget* CollectedCookiesGtk::CreateBlockedPane() { GtkWidget* button_box = gtk_hbutton_box_new(); gtk_button_box_set_layout(GTK_BUTTON_BOX(button_box), GTK_BUTTONBOX_START); - gtk_box_set_spacing(GTK_BOX(button_box), ui::kControlSpacing); + gtk_box_set_spacing(GTK_BOX(button_box), gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(cookie_list_vbox), button_box, FALSE, FALSE, - ui::kControlSpacing); + gtk_util::kControlSpacing); allow_blocked_cookie_button_ = gtk_button_new_with_label( l10n_util::GetStringUTF8(IDS_COLLECTED_COOKIES_ALLOW_BUTTON).c_str()); g_signal_connect(allow_blocked_cookie_button_, "clicked", @@ -322,7 +321,7 @@ GtkWidget* CollectedCookiesGtk::CreateBlockedPane() { // horizontal axis. GtkWidget* box = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(box), cookie_list_vbox, TRUE, TRUE, - ui::kControlSpacing); + gtk_util::kControlSpacing); return box; } diff --git a/chrome/browser/ui/gtk/constrained_html_delegate_gtk.cc b/chrome/browser/ui/gtk/constrained_html_delegate_gtk.cc index 386f92d..1bd3468 100644 --- a/chrome/browser/ui/gtk/constrained_html_delegate_gtk.cc +++ b/chrome/browser/ui/gtk/constrained_html_delegate_gtk.cc @@ -6,6 +6,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/gtk/constrained_window_gtk.h" +#include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/browser/ui/gtk/tab_contents_container_gtk.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h" @@ -13,7 +14,6 @@ #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/common/notification_source.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/gfx/rect.h" class ConstrainedHtmlDelegateGtk : public ConstrainedWindowGtkDelegate, @@ -42,7 +42,7 @@ class ConstrainedHtmlDelegateGtk : public ConstrainedWindowGtkDelegate, virtual HtmlDialogUIDelegate* GetHtmlDialogUIDelegate(); virtual void OnDialogClose(); virtual bool GetBackgroundColor(GdkColor* color) { - *color = ui::kGdkWhite; + *color = gtk_util::kGdkWhite; return true; } diff --git a/chrome/browser/ui/gtk/constrained_window_gtk.cc b/chrome/browser/ui/gtk/constrained_window_gtk.cc index f2026a8..f2fcbd0 100644 --- a/chrome/browser/ui/gtk/constrained_window_gtk.cc +++ b/chrome/browser/ui/gtk/constrained_window_gtk.cc @@ -10,7 +10,6 @@ #include "chrome/browser/ui/gtk/gtk_util.h" #include "content/browser/browser_thread.h" #include "content/browser/tab_contents/tab_contents.h" -#include "ui/base/gtk/gtk_hig_constants.h" #if defined(TOUCH_UI) #include "chrome/browser/ui/views/tab_contents/tab_contents_view_touch.h" @@ -51,8 +50,8 @@ ConstrainedWindowGtk::ConstrainedWindowGtk( GtkWidget* alignment = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); if (delegate->ShouldHaveBorderPadding()) { gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), - ui::kContentAreaBorder, ui::kContentAreaBorder, - ui::kContentAreaBorder, ui::kContentAreaBorder); + gtk_util::kContentAreaBorder, gtk_util::kContentAreaBorder, + gtk_util::kContentAreaBorder, gtk_util::kContentAreaBorder); } GdkColor background; diff --git a/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc b/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc index 77c67b6..1018b41 100644 --- a/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc @@ -22,7 +22,6 @@ #include "content/common/notification_source.h" #include "grit/generated_resources.h" #include "grit/ui_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/text/text_elider.h" #include "ui/gfx/gtk_util.h" @@ -89,7 +88,7 @@ void ContentSettingBubbleGtk::Observe(int type, void ContentSettingBubbleGtk::BuildBubble() { GtkThemeService* theme_provider = GtkThemeService::GetFrom(profile_); - GtkWidget* bubble_content = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* bubble_content = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_container_set_border_width(GTK_CONTAINER(bubble_content), kContentBorder); const ContentSettingBubbleModel::BubbleContent& content = @@ -103,7 +102,7 @@ void ContentSettingBubbleGtk::BuildBubble() { const std::set<std::string>& plugins = content.resource_identifiers; if (!plugins.empty()) { - GtkWidget* list_content = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* list_content = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); for (std::set<std::string>::const_iterator it = plugins.begin(); it != plugins.end(); ++it) { @@ -121,7 +120,7 @@ void ContentSettingBubbleGtk::BuildBubble() { FALSE, FALSE, 0); } gtk_box_pack_start(GTK_BOX(bubble_content), list_content, FALSE, FALSE, - ui::kControlSpacing); + gtk_util::kControlSpacing); } if (content_setting_bubble_model_->content_type() == @@ -147,8 +146,8 @@ void ContentSettingBubbleGtk::BuildBubble() { g_signal_connect(event_box, "button_press_event", G_CALLBACK(OnPopupIconButtonPressThunk), this); gtk_table_attach(GTK_TABLE(table), event_box, 0, 1, row, row + 1, - GTK_FILL, GTK_FILL, ui::kControlSpacing / 2, - ui::kControlSpacing / 2); + GTK_FILL, GTK_FILL, gtk_util::kControlSpacing / 2, + gtk_util::kControlSpacing / 2); } GtkWidget* button = gtk_chrome_link_button_new( @@ -157,8 +156,8 @@ void ContentSettingBubbleGtk::BuildBubble() { g_signal_connect(button, "clicked", G_CALLBACK(OnPopupLinkClickedThunk), this); gtk_table_attach(GTK_TABLE(table), button, 1, 2, row, row + 1, - GTK_FILL, GTK_FILL, ui::kControlSpacing / 2, - ui::kControlSpacing / 2); + GTK_FILL, GTK_FILL, gtk_util::kControlSpacing / 2, + gtk_util::kControlSpacing / 2); } gtk_box_pack_start(GTK_BOX(bubble_content), table, FALSE, FALSE, 0); @@ -194,7 +193,7 @@ void ContentSettingBubbleGtk::BuildBubble() { content.domain_lists.begin(); i != content.domain_lists.end(); ++i) { // Put each list into its own vbox to allow spacing between lists. - GtkWidget* list_content = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* list_content = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); GtkWidget* label = gtk_label_new(BuildElidedText(i->title).c_str()); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); @@ -208,7 +207,7 @@ void ContentSettingBubbleGtk::BuildBubble() { FALSE, FALSE, 0); } gtk_box_pack_start(GTK_BOX(bubble_content), list_content, FALSE, FALSE, - ui::kControlSpacing); + gtk_util::kControlSpacing); } if (!content.custom_link.empty()) { diff --git a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc index 8229d44..8ef68f9 100644 --- a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc @@ -22,7 +22,6 @@ #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "grit/theme_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/gtk_util.h" @@ -103,17 +102,17 @@ void CreateApplicationShortcutsDialogGtk::CreateDialogBox(GtkWindow* parent) { GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(create_dialog_)); - gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); - GtkWidget* vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_container_add(GTK_CONTAINER(content_area), vbox); // Create a box containing basic information about the new shortcut: an image // on the left, and a description on the right. - GtkWidget* hbox = gtk_hbox_new(FALSE, ui::kControlSpacing); + GtkWidget* hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(hbox), - ui::kControlSpacing); + gtk_util::kControlSpacing); // Put the icon preview in place. GtkWidget* favicon_image = gtk_image_new_from_pixbuf(favicon_pixbuf_); @@ -132,7 +131,7 @@ void CreateApplicationShortcutsDialogGtk::CreateDialogBox(GtkWindow* parent) { gtk_util::GetWidgetSizeFromResources( description_label, IDS_CREATE_SHORTCUTS_DIALOG_WIDTH_CHARS, -1, &label_width, NULL); - label_width -= ui::kControlSpacing * 3 + + label_width -= gtk_util::kControlSpacing * 3 + gdk_pixbuf_get_width(favicon_pixbuf_); gtk_util::SetLabelWidth(description_label, label_width); @@ -244,9 +243,9 @@ void CreateApplicationShortcutsDialogGtk::ShowErrorDialog() { false); // resizable GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(error_dialog_)); - gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); - GtkWidget* vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_container_add(GTK_CONTAINER(content_area), vbox); // Label on top of the checkboxes. diff --git a/chrome/browser/ui/gtk/crypto_module_password_dialog.cc b/chrome/browser/ui/gtk/crypto_module_password_dialog.cc index c411452..b9c9f6e 100644 --- a/chrome/browser/ui/gtk/crypto_module_password_dialog.cc +++ b/chrome/browser/ui/gtk/crypto_module_password_dialog.cc @@ -15,7 +15,6 @@ #include "content/browser/browser_thread.h" #include "googleurl/src/gurl.h" #include "grit/generated_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/gtk/gtk_signal.h" #include "ui/base/l10n/l10n_util.h" @@ -168,7 +167,7 @@ CryptoModulePasswordDialog::CryptoModulePasswordDialog( gtk_entry_set_activates_default(GTK_ENTRY(password_entry_), TRUE); gtk_entry_set_visibility(GTK_ENTRY(password_entry_), FALSE); - GtkWidget* password_box = gtk_hbox_new(FALSE, ui::kLabelSpacing); + GtkWidget* password_box = gtk_hbox_new(FALSE, gtk_util::kLabelSpacing); gtk_box_pack_start(GTK_BOX(password_box), gtk_label_new(l10n_util::GetStringUTF8( IDS_CRYPTO_MODULE_AUTH_DIALOG_PASSWORD_FIELD).c_str()), diff --git a/chrome/browser/ui/gtk/edit_search_engine_dialog.cc b/chrome/browser/ui/gtk/edit_search_engine_dialog.cc index 74730ab..c501103 100644 --- a/chrome/browser/ui/gtk/edit_search_engine_dialog.cc +++ b/chrome/browser/ui/gtk/edit_search_engine_dialog.cc @@ -20,7 +20,6 @@ #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "grit/ui_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image.h" @@ -208,7 +207,7 @@ void EditSearchEngineDialog::Init(GtkWindow* parent_window, Profile* profile) { FALSE, FALSE, 0); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), - ui::kContentAreaSpacing); + gtk_util::kContentAreaSpacing); EnableControls(); diff --git a/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc b/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc index c9a5806..889a85e 100644 --- a/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc @@ -15,7 +15,6 @@ #include "chrome/common/extensions/extension.h" #include "grit/generated_resources.h" #include "skia/ext/image_operations.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/gtk_util.h" @@ -76,9 +75,9 @@ void ShowInstallDialog(GtkWindow* parent, // Create a two column layout. GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog)); - gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); - GtkWidget* icon_hbox = gtk_hbox_new(FALSE, ui::kContentAreaSpacing); + GtkWidget* icon_hbox = gtk_hbox_new(FALSE, gtk_util::kContentAreaSpacing); gtk_box_pack_start(GTK_BOX(content_area), icon_hbox, TRUE, TRUE, 0); // Resize the icon if necessary. @@ -98,7 +97,7 @@ void ShowInstallDialog(GtkWindow* parent, gtk_misc_set_alignment(GTK_MISC(icon), 0.5, 0.0); // Create a new vbox for the right column. - GtkWidget* right_column_area = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* right_column_area = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(icon_hbox), right_column_area, TRUE, TRUE, 0); std::string heading_text = l10n_util::GetStringFUTF8( diff --git a/chrome/browser/ui/gtk/extensions/extension_uninstall_dialog_gtk.cc b/chrome/browser/ui/gtk/extensions/extension_uninstall_dialog_gtk.cc index 583805d..04e16eb 100644 --- a/chrome/browser/ui/gtk/extensions/extension_uninstall_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/extensions/extension_uninstall_dialog_gtk.cc @@ -13,9 +13,9 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/gtk/browser_window_gtk.h" +#include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/common/extensions/extension.h" #include "grit/generated_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/gtk_util.h" @@ -54,9 +54,9 @@ void ShowUninstallDialogGtk(GtkWindow* parent, // Create a two column layout. GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog)); - gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); - GtkWidget* icon_hbox = gtk_hbox_new(FALSE, ui::kContentAreaSpacing); + GtkWidget* icon_hbox = gtk_hbox_new(FALSE, gtk_util::kContentAreaSpacing); gtk_box_pack_start(GTK_BOX(content_area), icon_hbox, TRUE, TRUE, 0); // Put Icon in the left column. diff --git a/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc b/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc index ab178b5..6d26a0b 100644 --- a/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc @@ -17,7 +17,6 @@ #include "chrome/browser/ui/gtk/gtk_util.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/text/text_elider.h" @@ -80,9 +79,9 @@ ExternalProtocolDialogGtk::ExternalProtocolDialogGtk(const GURL& url) message_text += l10n_util::GetStringUTF8(IDS_EXTERNAL_PROTOCOL_WARNING); // Create the content-holding vbox. - GtkWidget* vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_container_set_border_width(GTK_CONTAINER(vbox), - ui::kContentAreaBorder); + gtk_util::kContentAreaBorder); // Add the message text. GtkWidget* label = gtk_label_new(message_text.c_str()); diff --git a/chrome/browser/ui/gtk/find_bar_gtk.cc b/chrome/browser/ui/gtk/find_bar_gtk.cc index 527d825..1faed02 100644 --- a/chrome/browser/ui/gtk/find_bar_gtk.cc +++ b/chrome/browser/ui/gtk/find_bar_gtk.cc @@ -41,7 +41,6 @@ #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" #include "ui/base/gtk/gtk_floating_container.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" @@ -49,11 +48,11 @@ namespace { // Used as the color of the text in the entry box and the text for the results // label for failure searches. -const GdkColor kEntryTextColor = ui::kGdkBlack; +const GdkColor kEntryTextColor = gtk_util::kGdkBlack; // Used as the color of the background of the entry box and the background of // the find label for successful searches. -const GdkColor kEntryBackgroundColor = ui::kGdkWhite; +const GdkColor kEntryBackgroundColor = gtk_util::kGdkWhite; const GdkColor kFindFailureBackgroundColor = GDK_COLOR_RGB(255, 102, 102); const GdkColor kFindSuccessTextColor = GDK_COLOR_RGB(178, 178, 178); @@ -502,7 +501,7 @@ void FindBarGtk::Observe(int type, gtk_misc_set_alignment(GTK_MISC(match_count_label_), 0.5, 0.5); } else { gtk_widget_modify_cursor( - text_entry_, &ui::kGdkBlack, &ui::kGdkGray); + text_entry_, >k_util::kGdkBlack, >k_util::kGdkGray); gtk_widget_modify_base(text_entry_, GTK_STATE_NORMAL, &kEntryBackgroundColor); gtk_widget_modify_text(text_entry_, GTK_STATE_NORMAL, diff --git a/chrome/browser/ui/gtk/first_run_bubble.cc b/chrome/browser/ui/gtk/first_run_bubble.cc index aacc0fe..86c6f42 100644 --- a/chrome/browser/ui/gtk/first_run_bubble.cc +++ b/chrome/browser/ui/gtk/first_run_bubble.cc @@ -17,7 +17,6 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" namespace { @@ -102,7 +101,7 @@ FirstRunBubble::~FirstRunBubble() { void FirstRunBubble::InitializeContentForLarge( std::vector<GtkWidget*>* labels) { - GtkWidget* label1 = theme_service_->BuildLabel("", ui::kGdkBlack); + GtkWidget* label1 = theme_service_->BuildLabel("", gtk_util::kGdkBlack); labels->push_back(label1); char* markup = g_markup_printf_escaped(kSearchLabelMarkup, l10n_util::GetStringUTF8(IDS_FR_BUBBLE_TITLE).c_str()); @@ -110,13 +109,13 @@ void FirstRunBubble::InitializeContentForLarge( g_free(markup); GtkWidget* label2 = theme_service_->BuildLabel( - l10n_util::GetStringUTF8(IDS_FR_BUBBLE_SUBTEXT), ui::kGdkBlack); + l10n_util::GetStringUTF8(IDS_FR_BUBBLE_SUBTEXT), gtk_util::kGdkBlack); labels->push_back(label2); string16 search_engine = GetDefaultSearchEngineName(profile_); GtkWidget* label3 = theme_service_->BuildLabel( l10n_util::GetStringFUTF8(IDS_FR_BUBBLE_QUESTION, search_engine), - ui::kGdkBlack); + gtk_util::kGdkBlack); labels->push_back(label3); GtkWidget* keep_button = gtk_button_new_with_label( @@ -155,7 +154,7 @@ void FirstRunBubble::InitializeContentForOEM(std::vector<GtkWidget*>* labels) { void FirstRunBubble::InitializeContentForMinimal( std::vector<GtkWidget*>* labels) { - GtkWidget* label1 = theme_service_->BuildLabel("", ui::kGdkBlack); + GtkWidget* label1 = theme_service_->BuildLabel("", gtk_util::kGdkBlack); labels->push_back(label1); char* markup = g_markup_printf_escaped(kSearchLabelMarkup, l10n_util::GetStringFUTF8( @@ -165,7 +164,7 @@ void FirstRunBubble::InitializeContentForMinimal( g_free(markup); GtkWidget* label2 = theme_service_->BuildLabel( - l10n_util::GetStringUTF8(IDS_FR_BUBBLE_SUBTEXT), ui::kGdkBlack); + l10n_util::GetStringUTF8(IDS_FR_BUBBLE_SUBTEXT), gtk_util::kGdkBlack); labels->push_back(label2); gtk_box_pack_start(GTK_BOX(content_), label1, FALSE, FALSE, 0); diff --git a/chrome/browser/ui/gtk/first_run_dialog.cc b/chrome/browser/ui/gtk/first_run_dialog.cc index 2143681..3b6fb88 100644 --- a/chrome/browser/ui/gtk/first_run_dialog.cc +++ b/chrome/browser/ui/gtk/first_run_dialog.cc @@ -29,7 +29,6 @@ #include "grit/locale_settings.h" #include "grit/theme_resources.h" #include "ui/base/gtk/gtk_floating_container.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image.h" @@ -79,8 +78,8 @@ void SetWelcomePosition(GtkFloatingContainer* container, gtk_widget_size_request(label, &req); int x = base::i18n::IsRTL() ? - allocation->width - req.width - ui::kContentAreaSpacing : - ui::kContentAreaSpacing; + allocation->width - req.width - gtk_util::kContentAreaSpacing : + gtk_util::kContentAreaSpacing; g_value_set_int(&value, x); gtk_container_child_set_property(GTK_CONTAINER(container), label, "x", &value); @@ -214,18 +213,18 @@ void FirstRunDialog::ShowSearchEngineWindow() { GtkWidget* bubble_area_background = gtk_event_box_new(); gtk_widget_modify_bg(bubble_area_background, - GTK_STATE_NORMAL, &ui::kGdkWhite); + GTK_STATE_NORMAL, >k_util::kGdkWhite); GtkWidget* bubble_area_box = gtk_vbox_new(FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(bubble_area_box), - ui::kContentAreaSpacing); + gtk_util::kContentAreaSpacing); gtk_container_add(GTK_CONTAINER(bubble_area_background), bubble_area_box); GtkWidget* explanation = gtk_label_new( l10n_util::GetStringFUTF8(IDS_FR_SEARCH_TEXT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)).c_str()); - gtk_util::SetLabelColor(explanation, &ui::kGdkBlack); + gtk_util::SetLabelColor(explanation, >k_util::kGdkBlack); gtk_util::SetLabelWidth(explanation, kExplanationWidth); gtk_box_pack_start(GTK_BOX(bubble_area_box), explanation, FALSE, FALSE, 0); @@ -328,7 +327,7 @@ void FirstRunDialog::OnTemplateURLServiceChanged() { search_engine_iter < ballot_engines.end(); ++search_engine_iter) { // Create a container for the search engine widgets. - GtkWidget* vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); // We show text on Chromium and images on Google Chrome. bool show_images = false; diff --git a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc index a7dcd12..8197fd26 100644 --- a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc @@ -10,7 +10,6 @@ #include "grit/generated_resources.h" #include "grit/ui_strings.h" #include "ui/base/gtk/gtk_floating_container.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" FullscreenExitBubbleGtk::FullscreenExitBubbleGtk( @@ -44,9 +43,9 @@ void FullscreenExitBubbleGtk::InitWidgets() { signals_.Connect(link, "clicked", G_CALLBACK(OnLinkClickedThunk), this); link_container_.Own(gtk_util::CreateGtkBorderBin( - link, &ui::kGdkBlack, + link, >k_util::kGdkBlack, kPaddingPx, kPaddingPx, kPaddingPx, kPaddingPx)); - gtk_util::ActAsRoundedWindow(link_container_.get(), ui::kGdkGreen, + gtk_util::ActAsRoundedWindow(link_container_.get(), gtk_util::kGdkGreen, kPaddingPx, gtk_util::ROUNDED_BOTTOM_LEFT | gtk_util::ROUNDED_BOTTOM_RIGHT, gtk_util::BORDER_NONE); diff --git a/chrome/browser/ui/gtk/gtk_chrome_cookie_view.cc b/chrome/browser/ui/gtk/gtk_chrome_cookie_view.cc index ebc91e6..e1844ba 100644 --- a/chrome/browser/ui/gtk/gtk_chrome_cookie_view.cc +++ b/chrome/browser/ui/gtk/gtk_chrome_cookie_view.cc @@ -6,8 +6,8 @@ #include "base/i18n/time_formatting.h" #include "base/utf_string_conversions.h" +#include "chrome/browser/ui/gtk/gtk_util.h" #include "grit/generated_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/text/bytes_formatting.h" @@ -295,7 +295,7 @@ void BuildWidgets(GtkChromeCookieView *self, gboolean editable_expiration) { gtk_container_add(GTK_CONTAINER(self->table_box_), self->cookie_details_table_); gtk_table_set_col_spacing(GTK_TABLE(self->cookie_details_table_), 0, - ui::kLabelSpacing); + gtk_util::kLabelSpacing); int row = 0; self->first_label_ = InitDetailRow(row++, IDS_COOKIES_COOKIE_NAME_LABEL, @@ -325,7 +325,7 @@ void BuildWidgets(GtkChromeCookieView *self, gboolean editable_expiration) { gtk_container_add(GTK_CONTAINER(self->table_box_), self->database_details_table_); gtk_table_set_col_spacing(GTK_TABLE(self->database_details_table_), 0, - ui::kLabelSpacing); + gtk_util::kLabelSpacing); InitDetailRow(row++, IDS_COOKIES_COOKIE_NAME_LABEL, self->database_details_table_, &self->database_name_entry_); @@ -343,7 +343,7 @@ void BuildWidgets(GtkChromeCookieView *self, gboolean editable_expiration) { gtk_container_add(GTK_CONTAINER(self->table_box_), self->local_storage_details_table_); gtk_table_set_col_spacing(GTK_TABLE(self->local_storage_details_table_), 0, - ui::kLabelSpacing); + gtk_util::kLabelSpacing); row = 0; InitDetailRow(row++, IDS_COOKIES_LOCAL_STORAGE_ORIGIN_LABEL, @@ -361,7 +361,7 @@ void BuildWidgets(GtkChromeCookieView *self, gboolean editable_expiration) { gtk_container_add(GTK_CONTAINER(self->table_box_), self->appcache_details_table_); gtk_table_set_col_spacing(GTK_TABLE(self->appcache_details_table_), 0, - ui::kLabelSpacing); + gtk_util::kLabelSpacing); row = 0; InitDetailRow(row++, IDS_COOKIES_APPLICATION_CACHE_MANIFEST_LABEL, @@ -380,7 +380,7 @@ void BuildWidgets(GtkChromeCookieView *self, gboolean editable_expiration) { gtk_container_add(GTK_CONTAINER(self->table_box_), self->indexed_db_details_table_); gtk_table_set_col_spacing(GTK_TABLE(self->indexed_db_details_table_), 0, - ui::kLabelSpacing); + gtk_util::kLabelSpacing); row = 0; InitDetailRow(row++, IDS_COOKIES_LOCAL_STORAGE_ORIGIN_LABEL, @@ -397,7 +397,7 @@ void BuildWidgets(GtkChromeCookieView *self, gboolean editable_expiration) { gtk_container_add(GTK_CONTAINER(self->table_box_), self->local_storage_item_table_); gtk_table_set_col_spacing(GTK_TABLE(self->local_storage_item_table_), 0, - ui::kLabelSpacing); + gtk_util::kLabelSpacing); row = 0; InitDetailRow(row++, IDS_COOKIES_COOKIE_DOMAIN_LABEL, @@ -415,7 +415,7 @@ void BuildWidgets(GtkChromeCookieView *self, gboolean editable_expiration) { gtk_container_add(GTK_CONTAINER(self->table_box_), self->database_accessed_table_); gtk_table_set_col_spacing(GTK_TABLE(self->local_storage_item_table_), 0, - ui::kLabelSpacing); + gtk_util::kLabelSpacing); row = 0; InitDetailRow(row++, IDS_COOKIES_COOKIE_DOMAIN_LABEL, @@ -436,7 +436,7 @@ void BuildWidgets(GtkChromeCookieView *self, gboolean editable_expiration) { gtk_container_add(GTK_CONTAINER(self->table_box_), self->appcache_created_table_); gtk_table_set_col_spacing(GTK_TABLE(self->appcache_created_table_), 0, - ui::kLabelSpacing); + gtk_util::kLabelSpacing); row = 0; InitDetailRow(row++, IDS_COOKIES_APPLICATION_CACHE_MANIFEST_LABEL, self->appcache_created_table_, diff --git a/chrome/browser/ui/gtk/gtk_theme_service.cc b/chrome/browser/ui/gtk/gtk_theme_service.cc index cab2f69..a3d58da 100644 --- a/chrome/browser/ui/gtk/gtk_theme_service.cc +++ b/chrome/browser/ui/gtk/gtk_theme_service.cc @@ -36,7 +36,6 @@ #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkShader.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/gtk/gtk_signal_registrar.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas_skia.h" @@ -239,9 +238,9 @@ void BuildIconFromIDRWithColor(int id, void GdkColorHSLShift(const color_utils::HSL& shift, GdkColor* frame_color) { SkColor shifted = color_utils::HSLShift(GdkToSkColor(frame_color), shift); frame_color->pixel = 0; - frame_color->red = SkColorGetR(shifted) * ui::kSkiaToGDKMultiplier; - frame_color->green = SkColorGetG(shifted) * ui::kSkiaToGDKMultiplier; - frame_color->blue = SkColorGetB(shifted) * ui::kSkiaToGDKMultiplier; + frame_color->red = SkColorGetR(shifted) * kSkiaToGDKMultiplier; + frame_color->green = SkColorGetG(shifted) * kSkiaToGDKMultiplier; + frame_color->blue = SkColorGetB(shifted) * kSkiaToGDKMultiplier; } } // namespace diff --git a/chrome/browser/ui/gtk/gtk_util.cc b/chrome/browser/ui/gtk/gtk_util.cc index ecfbe15..2a8160d 100644 --- a/chrome/browser/ui/gtk/gtk_util.cc +++ b/chrome/browser/ui/gtk/gtk_util.cc @@ -35,7 +35,6 @@ #include "grit/theme_resources_standard.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkColor.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/text/text_elider.h" @@ -209,13 +208,18 @@ WindowOpenDisposition DispositionFromEventFlags(guint event_flags) { namespace gtk_util { +const GdkColor kGdkWhite = GDK_COLOR_RGB(0xff, 0xff, 0xff); +const GdkColor kGdkGray = GDK_COLOR_RGB(0x7f, 0x7f, 0x7f); +const GdkColor kGdkBlack = GDK_COLOR_RGB(0x00, 0x00, 0x00); +const GdkColor kGdkGreen = GDK_COLOR_RGB(0x00, 0xff, 0x00); + GtkWidget* CreateLabeledControlsGroup(std::vector<GtkWidget*>* labels, const char* text, ...) { va_list ap; va_start(ap, text); GtkWidget* table = gtk_table_new(0, 2, FALSE); - gtk_table_set_col_spacing(GTK_TABLE(table), 0, ui::kLabelSpacing); - gtk_table_set_row_spacings(GTK_TABLE(table), ui::kControlSpacing); + gtk_table_set_col_spacing(GTK_TABLE(table), 0, kLabelSpacing); + gtk_table_set_row_spacings(GTK_TABLE(table), kControlSpacing); for (guint row = 0; text; ++row) { gtk_table_resize(GTK_TABLE(table), row + 1, 2); @@ -662,7 +666,7 @@ GtkWidget* BuildDialogButton(GtkWidget* dialog, int ids_id, } GtkWidget* CreateEntryImageHBox(GtkWidget* entry, GtkWidget* image) { - GtkWidget* hbox = gtk_hbox_new(FALSE, ui::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; @@ -678,7 +682,7 @@ void SetLabelColor(GtkWidget* label, const GdkColor* color) { GtkWidget* 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, - ui::kGroupIndent, 0); + gtk_util::kGroupIndent, 0); gtk_container_add(GTK_CONTAINER(content_alignment), content); return content_alignment; } diff --git a/chrome/browser/ui/gtk/gtk_util.h b/chrome/browser/ui/gtk/gtk_util.h index f12c727..3347f1f 100644 --- a/chrome/browser/ui/gtk/gtk_util.h +++ b/chrome/browser/ui/gtk/gtk_util.h @@ -27,6 +27,14 @@ class GURL; class Profile; struct RendererPreferences; // from common/renderer_preferences.h +const int kSkiaToGDKMultiplier = 257; + +// Define a macro for creating GdkColors from RGB values. This is a macro to +// allow static construction of literals, etc. Use this like: +// GdkColor white = GDK_COLOR_RGB(0xff, 0xff, 0xff); +#define GDK_COLOR_RGB(r, g, b) {0, r * kSkiaToGDKMultiplier, \ + g * kSkiaToGDKMultiplier, b * kSkiaToGDKMultiplier} + namespace event_utils { // Translates event flags into what kind of disposition they represent. @@ -38,6 +46,32 @@ WindowOpenDisposition DispositionFromEventFlags(guint state); namespace gtk_util { +extern const GdkColor kGdkWhite; +extern const GdkColor kGdkGray; +extern const GdkColor kGdkBlack; +extern const GdkColor kGdkGreen; + +// 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 outside of a dialog's contents. +const int kContentAreaBorder = 12; + +// Spacing between groups of controls. +const int kContentAreaSpacing = 18; + +// Horizontal Spacing between controls in a form. +const int kFormControlSpacing = 10; + // 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 diff --git a/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc b/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc index 9003115..8b6ab75 100644 --- a/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc @@ -20,7 +20,6 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/gtk/gtk_signal.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" @@ -101,7 +100,7 @@ void HungRendererDialogGtk::Init() { // | kill button wait button| // ·-----------------------------------· GtkWidget* content_area = gtk_dialog_get_content_area(dialog_); - gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); GtkWidget* hbox = gtk_hbox_new(FALSE, 12); gtk_box_pack_start(GTK_BOX(content_area), hbox, TRUE, TRUE, 0); @@ -114,7 +113,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, ui::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/ui/gtk/importer/import_lock_dialog_gtk.cc b/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc index 51741c6..4df1394 100644 --- a/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc @@ -13,7 +13,6 @@ #include "content/browser/user_metrics.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" namespace importer { @@ -49,7 +48,7 @@ ImportLockDialogGtk::ImportLockDialogGtk(GtkWindow* parent, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT); GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); - gtk_box_set_spacing(GTK_BOX(content_area), ui::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/ui/gtk/importer/import_progress_dialog_gtk.cc b/chrome/browser/ui/gtk/importer/import_progress_dialog_gtk.cc index c32ce9b..a8f0b36 100644 --- a/chrome/browser/ui/gtk/importer/import_progress_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/importer/import_progress_dialog_gtk.cc @@ -14,7 +14,6 @@ #include "chrome/browser/ui/gtk/gtk_util.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" namespace { @@ -83,9 +82,9 @@ ImportProgressDialogGtk::ImportProgressDialogGtk( importer_host_->set_parent_window(GTK_WINDOW(dialog_)); GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); - gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); - GtkWidget* control_group = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* control_group = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); GtkWidget* import_info = gtk_label_new( l10n_util::GetStringFUTF8(IDS_IMPORT_PROGRESS_INFO, @@ -93,7 +92,7 @@ ImportProgressDialogGtk::ImportProgressDialogGtk( gtk_util::SetLabelWidth(import_info, 400); gtk_box_pack_start(GTK_BOX(control_group), import_info, FALSE, FALSE, 0); - GtkWidget* item_box = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* item_box = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); if (items_ & importer::HISTORY) { history_ = gtk_label_new( diff --git a/chrome/browser/ui/gtk/infobars/after_translate_infobar_gtk.cc b/chrome/browser/ui/gtk/infobars/after_translate_infobar_gtk.cc index df3ccd9..d48ebb0 100644 --- a/chrome/browser/ui/gtk/infobars/after_translate_infobar_gtk.cc +++ b/chrome/browser/ui/gtk/infobars/after_translate_infobar_gtk.cc @@ -9,7 +9,6 @@ #include "chrome/browser/translate/translate_infobar_delegate.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "grit/generated_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" AfterTranslateInfoBar::AfterTranslateInfoBar( @@ -31,7 +30,7 @@ void AfterTranslateInfoBar::Init() { &strings, &swapped_language_combos); DCHECK(strings.size() == 3U); - GtkWidget* hbox = gtk_hbox_new(FALSE, ui::kControlSpacing); + GtkWidget* hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); gtk_util::CenterWidgetInHBox(hbox_, hbox, false, 0); GtkWidget* original_lang_combo = diff --git a/chrome/browser/ui/gtk/infobars/before_translate_infobar_gtk.cc b/chrome/browser/ui/gtk/infobars/before_translate_infobar_gtk.cc index 02ba8dd..8bfb29c 100644 --- a/chrome/browser/ui/gtk/infobars/before_translate_infobar_gtk.cc +++ b/chrome/browser/ui/gtk/infobars/before_translate_infobar_gtk.cc @@ -8,7 +8,6 @@ #include "chrome/browser/translate/translate_infobar_delegate.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "grit/generated_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" BeforeTranslateInfoBar::BeforeTranslateInfoBar( @@ -23,7 +22,7 @@ BeforeTranslateInfoBar::~BeforeTranslateInfoBar() { void BeforeTranslateInfoBar::Init() { TranslateInfoBarBase::Init(); - GtkWidget* hbox = gtk_hbox_new(FALSE, ui::kControlSpacing); + GtkWidget* hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); gtk_util::CenterWidgetInHBox(hbox_, hbox, false, 0); size_t offset = 0; string16 text = diff --git a/chrome/browser/ui/gtk/infobars/infobar_gtk.cc b/chrome/browser/ui/gtk/infobars/infobar_gtk.cc index 38f7f48..c1ad824 100644 --- a/chrome/browser/ui/gtk/infobars/infobar_gtk.cc +++ b/chrome/browser/ui/gtk/infobars/infobar_gtk.cc @@ -15,7 +15,6 @@ #include "chrome/common/chrome_notification_types.h" #include "content/common/notification_service.h" #include "ui/base/gtk/gtk_expanded_container.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/gfx/gtk_util.h" #include "ui/gfx/image/image.h" @@ -113,7 +112,7 @@ int InfoBarGtk::AnimatingHeight() const { } GtkWidget* InfoBarGtk::CreateLabel(const std::string& text) { - return theme_service_->BuildLabel(text, ui::kGdkBlack); + return theme_service_->BuildLabel(text, gtk_util::kGdkBlack); } GtkWidget* InfoBarGtk::CreateLinkButton(const std::string& text) { diff --git a/chrome/browser/ui/gtk/infobars/translate_message_infobar_gtk.cc b/chrome/browser/ui/gtk/infobars/translate_message_infobar_gtk.cc index c7754fe..7ecbc16 100644 --- a/chrome/browser/ui/gtk/infobars/translate_message_infobar_gtk.cc +++ b/chrome/browser/ui/gtk/infobars/translate_message_infobar_gtk.cc @@ -7,7 +7,6 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/translate/translate_infobar_delegate.h" #include "chrome/browser/ui/gtk/gtk_util.h" -#include "ui/base/gtk/gtk_hig_constants.h" TranslateMessageInfoBar::TranslateMessageInfoBar( TabContentsWrapper* owner, @@ -21,7 +20,7 @@ TranslateMessageInfoBar::~TranslateMessageInfoBar() { void TranslateMessageInfoBar::Init() { TranslateInfoBarBase::Init(); - GtkWidget* hbox = gtk_hbox_new(FALSE, ui::kControlSpacing); + GtkWidget* hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); gtk_util::CenterWidgetInHBox(hbox_, hbox, false, 0); std::string text = UTF16ToUTF8(GetDelegate()->GetMessageInfoBarText()); diff --git a/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.cc b/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.cc index 24881eb..0cdf899 100644 --- a/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.cc @@ -12,10 +12,10 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" +#include "chrome/browser/ui/gtk/gtk_util.h" #include "googleurl/src/gurl.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" namespace browser { @@ -38,7 +38,7 @@ InstantConfirmDialogGtk::InstantConfirmDialogGtk( g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); GtkBox* vbox = GTK_BOX(GTK_DIALOG(dialog_)->vbox); - gtk_box_set_spacing(vbox, ui::kControlSpacing); + gtk_box_set_spacing(vbox, gtk_util::kControlSpacing); GtkWidget* label = gtk_label_new( l10n_util::GetStringUTF8(IDS_INSTANT_OPT_IN_MESSAGE).c_str()); diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.cc b/chrome/browser/ui/gtk/location_bar_view_gtk.cc index 27613f4..a133944 100644 --- a/chrome/browser/ui/gtk/location_bar_view_gtk.cc +++ b/chrome/browser/ui/gtk/location_bar_view_gtk.cc @@ -60,7 +60,6 @@ #include "grit/theme_resources_standard.h" #include "net/base/net_util.h" #include "ui/base/dragdrop/gtk_dnd_util.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas_skia_paint.h" @@ -224,9 +223,9 @@ void LocationBarViewGtk::Init(bool popup_window_mode) { // Tab to search (the keyword box on the left hand side). tab_to_search_full_label_ = - theme_service_->BuildLabel("", ui::kGdkBlack); + theme_service_->BuildLabel("", gtk_util::kGdkBlack); tab_to_search_partial_label_ = - theme_service_->BuildLabel("", ui::kGdkBlack); + theme_service_->BuildLabel("", gtk_util::kGdkBlack); GtkWidget* tab_to_search_label_hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(tab_to_search_label_hbox), tab_to_search_full_label_, FALSE, FALSE, 0); diff --git a/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc b/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc index 2f64273..f9717fa 100644 --- a/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc +++ b/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc @@ -38,7 +38,6 @@ #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" #include "ui/base/animation/slide_animation.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" @@ -318,7 +317,7 @@ void BalloonViewImpl::Show(Balloon* balloon) { Source<ThemeService>(theme_service_)); // We don't do InitThemesFor() because it just forces a redraw. - gtk_util::ActAsRoundedWindow(frame_container_, ui::kGdkBlack, 3, + gtk_util::ActAsRoundedWindow(frame_container_, gtk_util::kGdkBlack, 3, gtk_util::ROUNDED_ALL, gtk_util::BORDER_ALL); diff --git a/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc b/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc index 4c3fa32..a3a85ed 100644 --- a/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc +++ b/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc @@ -28,7 +28,6 @@ #include "chrome/common/chrome_notification_types.h" #include "content/common/notification_service.h" #include "grit/theme_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/gtk/gtk_windowing.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/font.h" diff --git a/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk_unittest.cc b/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk_unittest.cc index cf72fbb..60d79f4 100644 --- a/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk_unittest.cc +++ b/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk_unittest.cc @@ -9,7 +9,7 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/autocomplete/autocomplete.h" #include "chrome/browser/autocomplete/autocomplete_match.h" -#include "ui/base/gtk/gtk_hig_constants.h" +#include "chrome/browser/ui/gtk/gtk_util.h" #include "testing/platform_test.h" namespace { diff --git a/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc b/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc index f16d3fa..b80d8a3f 100644 --- a/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc +++ b/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc @@ -33,7 +33,6 @@ #include "third_party/undoview/undo_view.h" #include "ui/base/animation/multi_animation.h" #include "ui/base/dragdrop/drag_drop_types.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_utils.h" @@ -969,7 +968,7 @@ void OmniboxViewGtk::SetBaseColor() { background_color_ptr = &LocationBarViewGtk::kBackgroundColor; #endif gtk_widget_modify_cursor( - text_view_, &ui::kGdkBlack, &ui::kGdkGray); + text_view_, >k_util::kGdkBlack, >k_util::kGdkGray); gtk_widget_modify_base(text_view_, GTK_STATE_NORMAL, background_color_ptr); #if !defined(TOOLKIT_VIEWS) diff --git a/chrome/browser/ui/gtk/page_info_bubble_gtk.cc b/chrome/browser/ui/gtk/page_info_bubble_gtk.cc index 115ad40..e6c2edf 100644 --- a/chrome/browser/ui/gtk/page_info_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/page_info_bubble_gtk.cc @@ -25,7 +25,6 @@ #include "googleurl/src/gurl.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" class Profile; @@ -136,9 +135,9 @@ void PageInfoBubbleGtk::BubbleClosing(BubbleGtk* bubble, void PageInfoBubbleGtk::InitContents() { if (!contents_) { - contents_ = gtk_vbox_new(FALSE, ui::kContentAreaSpacing); + contents_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaSpacing); gtk_container_set_border_width(GTK_CONTAINER(contents_), - ui::kContentAreaBorder); + gtk_util::kContentAreaBorder); } else { gtk_util::RemoveAllChildren(contents_); } @@ -166,7 +165,7 @@ void PageInfoBubbleGtk::InitContents() { GtkWidget* PageInfoBubbleGtk::CreateSection( const PageInfoModel::SectionInfo& section) { - GtkWidget* section_box = gtk_hbox_new(FALSE, ui::kControlSpacing); + GtkWidget* section_box = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); GdkPixbuf* pixbuf = *model_.GetIconImage(section.icon_id); if (pixbuf) { @@ -175,12 +174,12 @@ GtkWidget* PageInfoBubbleGtk::CreateSection( gtk_misc_set_alignment(GTK_MISC(image), 0, 0); } - GtkWidget* vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(section_box), vbox, TRUE, TRUE, 0); if (!section.headline.empty()) { GtkWidget* label = theme_service_->BuildLabel( - UTF16ToUTF8(section.headline), ui::kGdkBlack); + UTF16ToUTF8(section.headline), gtk_util::kGdkBlack); gtk_label_set_selectable(GTK_LABEL(label), TRUE); PangoAttrList* attributes = pango_attr_list_new(); pango_attr_list_insert(attributes, @@ -194,7 +193,7 @@ GtkWidget* PageInfoBubbleGtk::CreateSection( gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); } GtkWidget* label = theme_service_->BuildLabel( - UTF16ToUTF8(section.description), ui::kGdkBlack); + UTF16ToUTF8(section.description), gtk_util::kGdkBlack); gtk_label_set_selectable(GTK_LABEL(label), TRUE); gtk_util::SetLabelWidth(label, 400); // Allow linebreaking in the middle of words if necessary, so that extremely diff --git a/chrome/browser/ui/gtk/repost_form_warning_gtk.cc b/chrome/browser/ui/gtk/repost_form_warning_gtk.cc index 39d576c..cdf2db9 100644 --- a/chrome/browser/ui/gtk/repost_form_warning_gtk.cc +++ b/chrome/browser/ui/gtk/repost_form_warning_gtk.cc @@ -6,19 +6,19 @@ #include "base/message_loop.h" #include "chrome/browser/repost_form_warning_controller.h" +#include "chrome/browser/ui/gtk/gtk_util.h" #include "content/browser/browser_thread.h" #include "content/browser/tab_contents/navigation_controller.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/common/content_notification_types.h" #include "grit/generated_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" RepostFormWarningGtk::RepostFormWarningGtk(GtkWindow* parent, TabContents* tab_contents) : controller_(new RepostFormWarningController(tab_contents)) { - dialog_ = gtk_vbox_new(FALSE, ui::kContentAreaBorder); - gtk_box_set_spacing(GTK_BOX(dialog_), ui::kContentAreaSpacing); + dialog_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaBorder); + gtk_box_set_spacing(GTK_BOX(dialog_), gtk_util::kContentAreaSpacing); GtkWidget* label = gtk_label_new( l10n_util::GetStringUTF8(IDS_HTTP_POST_WARNING).c_str()); GtkWidget* image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_QUESTION, @@ -28,7 +28,7 @@ RepostFormWarningGtk::RepostFormWarningGtk(GtkWindow* parent, gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_label_set_selectable(GTK_LABEL(label), TRUE); - GtkWidget *hbox = gtk_hbox_new(FALSE, ui::kControlSpacing); + GtkWidget *hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); @@ -38,7 +38,7 @@ RepostFormWarningGtk::RepostFormWarningGtk(GtkWindow* parent, GtkWidget* buttonBox = gtk_hbutton_box_new(); gtk_button_box_set_layout(GTK_BUTTON_BOX(buttonBox), GTK_BUTTONBOX_END); - gtk_box_set_spacing(GTK_BOX(buttonBox), ui::kControlSpacing); + gtk_box_set_spacing(GTK_BOX(buttonBox), gtk_util::kControlSpacing); gtk_box_pack_end(GTK_BOX(dialog_), buttonBox, FALSE, TRUE, 0); cancel_ = gtk_button_new_from_stock(GTK_STOCK_CANCEL); diff --git a/chrome/browser/ui/gtk/sad_tab_gtk.cc b/chrome/browser/ui/gtk/sad_tab_gtk.cc index d818729..ad01d9b 100644 --- a/chrome/browser/ui/gtk/sad_tab_gtk.cc +++ b/chrome/browser/ui/gtk/sad_tab_gtk.cc @@ -8,12 +8,12 @@ #include "chrome/browser/google/google_util.h" #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" +#include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/common/url_constants.h" #include "content/browser/tab_contents/tab_contents.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "grit/theme_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image.h" @@ -42,7 +42,7 @@ GtkWidget* MakeWhiteMarkupLabel(const char* format, const std::string& str) { gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER); // Set text to white. - GdkColor white = ui::kGdkWhite; + GdkColor white = gtk_util::kGdkWhite; gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &white); return label; @@ -113,7 +113,7 @@ SadTabGtk::SadTabGtk(TabContents* tab_contents, Kind kind) GtkWidget* link = gtk_chrome_link_button_new( l10n_util::GetStringUTF8(IDS_LEARN_MORE).c_str()); gtk_chrome_link_button_set_normal_color(GTK_CHROME_LINK_BUTTON(link), - &ui::kGdkWhite); + >k_util::kGdkWhite); g_signal_connect(link, "clicked", G_CALLBACK(OnLinkButtonClickThunk), this); GtkWidget* link_alignment = gtk_alignment_new(0.5, 0.5, 0.0, 0.0); gtk_container_add(GTK_CONTAINER(link_alignment), link); diff --git a/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc b/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc index 11e9b7d..84a76aa 100644 --- a/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc +++ b/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc @@ -22,7 +22,6 @@ #include "content/browser/tab_contents/tab_contents.h" #include "grit/generated_resources.h" #include "net/base/x509_certificate.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/gtk/gtk_signal.h" #include "ui/base/gtk/owned_widget_gtk.h" #include "ui/base/l10n/l10n_util.h" @@ -105,9 +104,9 @@ SSLClientCertificateSelector::SSLClientCertificateSelector( delegate_(delegate), parent_(parent), window_(NULL) { - root_widget_.Own(gtk_vbox_new(FALSE, ui::kControlSpacing)); + root_widget_.Own(gtk_vbox_new(FALSE, gtk_util::kControlSpacing)); - GtkWidget* site_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* site_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(root_widget_.get()), site_vbox, FALSE, FALSE, 0); @@ -121,7 +120,7 @@ SSLClientCertificateSelector::SSLClientCertificateSelector( gtk_util::LeftAlignMisc(site_label); gtk_box_pack_start(GTK_BOX(site_vbox), site_label, FALSE, FALSE, 0); - GtkWidget* selector_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); + GtkWidget* selector_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(root_widget_.get()), selector_vbox, TRUE, TRUE, 0); @@ -160,7 +159,7 @@ SSLClientCertificateSelector::SSLClientCertificateSelector( // And then create a set of buttons like a GtkDialog would. GtkWidget* button_box = gtk_hbutton_box_new(); gtk_button_box_set_layout(GTK_BUTTON_BOX(button_box), GTK_BUTTONBOX_END); - gtk_box_set_spacing(GTK_BOX(button_box), ui::kControlSpacing); + gtk_box_set_spacing(GTK_BOX(button_box), gtk_util::kControlSpacing); gtk_box_pack_end(GTK_BOX(root_widget_.get()), button_box, FALSE, FALSE, 0); GtkWidget* view_button = gtk_button_new_with_mnemonic( diff --git a/chrome/browser/ui/gtk/status_bubble_gtk.cc b/chrome/browser/ui/gtk/status_bubble_gtk.cc index df31d84..6ca3435 100644 --- a/chrome/browser/ui/gtk/status_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/status_bubble_gtk.cc @@ -18,7 +18,6 @@ #include "chrome/common/chrome_notification_types.h" #include "content/common/notification_service.h" #include "ui/base/animation/slide_animation.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/text/text_elider.h" namespace { @@ -260,7 +259,7 @@ void StatusBubbleGtk::InitWidgets() { container_.Own(gtk_event_box_new()); gtk_widget_set_no_show_all(container_.get(), TRUE); gtk_util::ActAsRoundedWindow( - container_.get(), ui::kGdkWhite, kCornerSize, + container_.get(), gtk_util::kGdkWhite, kCornerSize, gtk_util::ROUNDED_TOP_RIGHT, gtk_util::BORDER_TOP | gtk_util::BORDER_RIGHT); gtk_widget_set_name(container_.get(), "status-bubble"); diff --git a/chrome/browser/ui/gtk/task_manager_gtk.cc b/chrome/browser/ui/gtk/task_manager_gtk.cc index ba434b1..cf908f8 100644 --- a/chrome/browser/ui/gtk/task_manager_gtk.cc +++ b/chrome/browser/ui/gtk/task_manager_gtk.cc @@ -29,7 +29,6 @@ #include "grit/chromium_strings.h" #include "grit/ui_resources.h" #include "third_party/skia/include/core/SkBitmap.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/models/simple_menu_model.h" #include "ui/base/resource/resource_bundle.h" @@ -499,7 +498,7 @@ void TaskManagerGtk::Init() { ConnectAccelerators(); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), - ui::kContentAreaSpacing); + gtk_util::kContentAreaSpacing); destroy_handler_id_ = g_signal_connect(dialog_, "destroy", G_CALLBACK(OnDestroyThunk), this); diff --git a/chrome/browser/ui/gtk/theme_install_bubble_view_gtk.cc b/chrome/browser/ui/gtk/theme_install_bubble_view_gtk.cc index b3df29a..604f899 100644 --- a/chrome/browser/ui/gtk/theme_install_bubble_view_gtk.cc +++ b/chrome/browser/ui/gtk/theme_install_bubble_view_gtk.cc @@ -11,7 +11,6 @@ #include "chrome/common/chrome_notification_types.h" #include "content/common/notification_service.h" #include "grit/generated_resources.h" -#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" // Roundedness of bubble. @@ -98,7 +97,7 @@ void ThemeInstallBubbleViewGtk::InitWidgets() { gtk_label_set_markup(GTK_LABEL(label), markup); g_free(markup); - gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &ui::kGdkWhite); + gtk_widget_modify_fg(label, GTK_STATE_NORMAL, >k_util::kGdkWhite); gtk_container_add(GTK_CONTAINER(widget_), label); // We need to show the label so we'll know the widget's actual size when we @@ -123,7 +122,7 @@ void ThemeInstallBubbleViewGtk::InitWidgets() { G_CALLBACK(OnExposeThunk), this); gtk_widget_realize(widget_); } else { - gtk_widget_modify_bg(widget_, GTK_STATE_NORMAL, &ui::kGdkBlack); + gtk_widget_modify_bg(widget_, GTK_STATE_NORMAL, >k_util::kGdkBlack); GdkColor color; gtk_util::ActAsRoundedWindow(widget_, color, kBubbleCornerRadius, gtk_util::ROUNDED_ALL, gtk_util::BORDER_NONE); |