diff options
Diffstat (limited to 'chrome/browser/ui')
48 files changed, 177 insertions, 178 deletions
diff --git a/chrome/browser/ui/gtk/about_chrome_dialog.cc b/chrome/browser/ui/gtk/about_chrome_dialog.cc index 61f8406..164ea80 100644 --- a/chrome/browser/ui/gtk/about_chrome_dialog.cc +++ b/chrome/browser/ui/gtk/about_chrome_dialog.cc @@ -16,7 +16,6 @@ #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" @@ -24,6 +23,7 @@ #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 = gtk_util::kGdkBlack; + GdkColor black = ui::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), - gtk_util::kContentAreaBorder, 0, - gtk_util::kContentAreaBorder, gtk_util::kContentAreaBorder); + ui::kContentAreaBorder, 0, + ui::kContentAreaBorder, ui::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 7b616af..f0b57ab 100644 --- a/chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc @@ -25,6 +25,7 @@ #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 { @@ -73,7 +74,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, >k_util::kGdkBlack); + gtk_widget_modify_fg(*it, GTK_STATE_NORMAL, &ui::kGdkBlack); } } } diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.cc index 21699a7..1dd66f0 100644 --- a/chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.cc +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.cc @@ -25,6 +25,7 @@ #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 +346,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), gtk_util::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), ui::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 90721a1..9d7cc33 100644 --- a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc @@ -16,6 +16,7 @@ #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" @@ -280,8 +281,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, >k_util::kGdkBlack); - gtk_widget_modify_fg(label, GTK_STATE_PRELIGHT, >k_util::kGdkBlack); + gtk_widget_modify_fg(label, GTK_STATE_ACTIVE, &ui::kGdkBlack); + gtk_widget_modify_fg(label, GTK_STATE_PRELIGHT, &ui::kGdkBlack); } } diff --git a/chrome/browser/ui/gtk/browser_titlebar.cc b/chrome/browser/ui/gtk/browser_titlebar.cc index 051c68e..29b826c 100644 --- a/chrome/browser/ui/gtk/browser_titlebar.cc +++ b/chrome/browser/ui/gtk/browser_titlebar.cc @@ -46,6 +46,7 @@ #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" @@ -758,10 +759,10 @@ void BrowserTitlebar::UpdateTextColor() { ThemeService::COLOR_FRAME_INACTIVE); } GdkColor text_color = PickLuminosityContrastingColor( - &frame_color, >k_util::kGdkWhite, >k_util::kGdkBlack); + &frame_color, &ui::kGdkWhite, &ui::kGdkBlack); gtk_util::SetLabelColor(app_mode_title_, &text_color); } else { - gtk_util::SetLabelColor(app_mode_title_, >k_util::kGdkWhite); + gtk_util::SetLabelColor(app_mode_title_, &ui::kGdkWhite); } } diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc index 9415480..04da093 100644 --- a/chrome/browser/ui/gtk/browser_window_gtk.cc +++ b/chrome/browser/ui/gtk/browser_window_gtk.cc @@ -91,6 +91,7 @@ #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" @@ -1752,7 +1753,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, - >k_util::kGdkWhite); + &ui::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 c017d05..b0eab61 100644 --- a/chrome/browser/ui/gtk/bubble/bubble_gtk.cc +++ b/chrome/browser/ui/gtk/bubble/bubble_gtk.cc @@ -12,6 +12,7 @@ #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 e062fec..7a07793 100644 --- a/chrome/browser/ui/gtk/certificate_viewer.cc +++ b/chrome/browser/ui/gtk/certificate_viewer.cc @@ -19,6 +19,7 @@ #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" @@ -148,7 +149,7 @@ CertificateViewer::CertificateViewer( GTK_RESPONSE_CLOSE, NULL); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), - gtk_util::kContentAreaSpacing); + ui::kContentAreaSpacing); x509_certificate_model::RegisterDynamicOids(); InitGeneralPage(); @@ -183,11 +184,11 @@ CertificateViewer::~CertificateViewer() { void CertificateViewer::InitGeneralPage() { net::X509Certificate::OSCertHandle cert = cert_chain_list_.front(); - general_page_vbox_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaSpacing); + general_page_vbox_ = gtk_vbox_new(FALSE, ui::kContentAreaSpacing); gtk_container_set_border_width(GTK_CONTAINER(general_page_vbox_), - gtk_util::kContentAreaBorder); + ui::kContentAreaBorder); - GtkWidget* uses_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); + GtkWidget* uses_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); gtk_box_pack_start(GTK_BOX(general_page_vbox_), uses_vbox, FALSE, FALSE, 0); gtk_box_pack_start( GTK_BOX(uses_vbox), @@ -209,8 +210,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, gtk_util::kLabelSpacing); - gtk_table_set_row_spacings(table, gtk_util::kControlSpacing); + gtk_table_set_col_spacing(table, 0, ui::kLabelSpacing); + gtk_table_set_row_spacings(table, ui::kControlSpacing); gtk_box_pack_start(GTK_BOX(general_page_vbox_), GTK_WIDGET(table), FALSE, FALSE, 0); @@ -524,11 +525,11 @@ GtkTreeStore* CertificateViewer::CreateFieldsTreeStore( } void CertificateViewer::InitDetailsPage() { - details_page_vbox_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaSpacing); + details_page_vbox_ = gtk_vbox_new(FALSE, ui::kContentAreaSpacing); gtk_container_set_border_width(GTK_CONTAINER(details_page_vbox_), - gtk_util::kContentAreaBorder); + ui::kContentAreaBorder); - GtkWidget* hierarchy_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); + GtkWidget* hierarchy_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); gtk_box_pack_start(GTK_BOX(details_page_vbox_), hierarchy_vbox, FALSE, FALSE, 0); @@ -567,7 +568,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, gtk_util::kControlSpacing); + GtkWidget* fields_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); gtk_box_pack_start(GTK_BOX(details_page_vbox_), fields_vbox, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(fields_vbox), @@ -597,7 +598,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, gtk_util::kControlSpacing); + GtkWidget* value_vbox = gtk_vbox_new(FALSE, ui::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 3fb3cae..e73a8a2 100644 --- a/chrome/browser/ui/gtk/collected_cookies_gtk.cc +++ b/chrome/browser/ui/gtk/collected_cookies_gtk.cc @@ -18,6 +18,7 @@ #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 { @@ -91,8 +92,8 @@ CollectedCookiesGtk::CollectedCookiesGtk(GtkWindow* parent, } void CollectedCookiesGtk::Init() { - dialog_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaSpacing); - gtk_box_set_spacing(GTK_BOX(dialog_), gtk_util::kContentAreaSpacing); + dialog_ = gtk_vbox_new(FALSE, ui::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(dialog_), ui::kContentAreaSpacing); GtkWidget* label = gtk_label_new( l10n_util::GetStringUTF8(IDS_COLLECTED_COOKIES_DIALOG_TITLE).c_str()); @@ -149,7 +150,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), gtk_util::kControlSpacing); + gtk_box_set_spacing(GTK_BOX(button_box), ui::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_), @@ -166,14 +167,14 @@ void CollectedCookiesGtk::Init() { } GtkWidget* CollectedCookiesGtk::CreateAllowedPane() { - GtkWidget* cookie_list_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); + GtkWidget* cookie_list_vbox = gtk_vbox_new(FALSE, ui::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, - gtk_util::kControlSpacing); + ui::kControlSpacing); GtkWidget* scroll_window = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_window), @@ -221,9 +222,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), gtk_util::kControlSpacing); + gtk_box_set_spacing(GTK_BOX(button_box), ui::kControlSpacing); gtk_box_pack_start(GTK_BOX(cookie_list_vbox), button_box, FALSE, FALSE, - gtk_util::kControlSpacing); + ui::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", @@ -234,7 +235,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, - gtk_util::kControlSpacing); + ui::kControlSpacing); return box; } @@ -244,7 +245,7 @@ GtkWidget* CollectedCookiesGtk::CreateBlockedPane() { HostContentSettingsMap* host_content_settings_map = wrapper->profile()->GetHostContentSettingsMap(); - GtkWidget* cookie_list_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); + GtkWidget* cookie_list_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); GtkWidget* label = gtk_label_new( l10n_util::GetStringUTF8( @@ -255,7 +256,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, - gtk_util::kControlSpacing); + ui::kControlSpacing); GtkWidget* scroll_window = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_window), @@ -301,9 +302,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), gtk_util::kControlSpacing); + gtk_box_set_spacing(GTK_BOX(button_box), ui::kControlSpacing); gtk_box_pack_start(GTK_BOX(cookie_list_vbox), button_box, FALSE, FALSE, - gtk_util::kControlSpacing); + ui::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", @@ -321,7 +322,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, - gtk_util::kControlSpacing); + ui::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 1bd3468..386f92d 100644 --- a/chrome/browser/ui/gtk/constrained_html_delegate_gtk.cc +++ b/chrome/browser/ui/gtk/constrained_html_delegate_gtk.cc @@ -6,7 +6,6 @@ #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" @@ -14,6 +13,7 @@ #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 = gtk_util::kGdkWhite; + *color = ui::kGdkWhite; return true; } diff --git a/chrome/browser/ui/gtk/constrained_window_gtk.cc b/chrome/browser/ui/gtk/constrained_window_gtk.cc index f2fcbd0..f2026a8 100644 --- a/chrome/browser/ui/gtk/constrained_window_gtk.cc +++ b/chrome/browser/ui/gtk/constrained_window_gtk.cc @@ -10,6 +10,7 @@ #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" @@ -50,8 +51,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), - gtk_util::kContentAreaBorder, gtk_util::kContentAreaBorder, - gtk_util::kContentAreaBorder, gtk_util::kContentAreaBorder); + ui::kContentAreaBorder, ui::kContentAreaBorder, + ui::kContentAreaBorder, ui::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 1018b41..77c67b6 100644 --- a/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc @@ -22,6 +22,7 @@ #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" @@ -88,7 +89,7 @@ void ContentSettingBubbleGtk::Observe(int type, void ContentSettingBubbleGtk::BuildBubble() { GtkThemeService* theme_provider = GtkThemeService::GetFrom(profile_); - GtkWidget* bubble_content = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); + GtkWidget* bubble_content = gtk_vbox_new(FALSE, ui::kControlSpacing); gtk_container_set_border_width(GTK_CONTAINER(bubble_content), kContentBorder); const ContentSettingBubbleModel::BubbleContent& content = @@ -102,7 +103,7 @@ void ContentSettingBubbleGtk::BuildBubble() { const std::set<std::string>& plugins = content.resource_identifiers; if (!plugins.empty()) { - GtkWidget* list_content = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); + GtkWidget* list_content = gtk_vbox_new(FALSE, ui::kControlSpacing); for (std::set<std::string>::const_iterator it = plugins.begin(); it != plugins.end(); ++it) { @@ -120,7 +121,7 @@ void ContentSettingBubbleGtk::BuildBubble() { FALSE, FALSE, 0); } gtk_box_pack_start(GTK_BOX(bubble_content), list_content, FALSE, FALSE, - gtk_util::kControlSpacing); + ui::kControlSpacing); } if (content_setting_bubble_model_->content_type() == @@ -146,8 +147,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, gtk_util::kControlSpacing / 2, - gtk_util::kControlSpacing / 2); + GTK_FILL, GTK_FILL, ui::kControlSpacing / 2, + ui::kControlSpacing / 2); } GtkWidget* button = gtk_chrome_link_button_new( @@ -156,8 +157,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, gtk_util::kControlSpacing / 2, - gtk_util::kControlSpacing / 2); + GTK_FILL, GTK_FILL, ui::kControlSpacing / 2, + ui::kControlSpacing / 2); } gtk_box_pack_start(GTK_BOX(bubble_content), table, FALSE, FALSE, 0); @@ -193,7 +194,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, gtk_util::kControlSpacing); + GtkWidget* list_content = gtk_vbox_new(FALSE, ui::kControlSpacing); GtkWidget* label = gtk_label_new(BuildElidedText(i->title).c_str()); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); @@ -207,7 +208,7 @@ void ContentSettingBubbleGtk::BuildBubble() { FALSE, FALSE, 0); } gtk_box_pack_start(GTK_BOX(bubble_content), list_content, FALSE, FALSE, - gtk_util::kControlSpacing); + ui::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 8ef68f9..8229d44 100644 --- a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc @@ -22,6 +22,7 @@ #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" @@ -102,17 +103,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), gtk_util::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); - GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, ui::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, gtk_util::kControlSpacing); + GtkWidget* hbox = gtk_hbox_new(FALSE, ui::kControlSpacing); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(hbox), - gtk_util::kControlSpacing); + ui::kControlSpacing); // Put the icon preview in place. GtkWidget* favicon_image = gtk_image_new_from_pixbuf(favicon_pixbuf_); @@ -131,7 +132,7 @@ void CreateApplicationShortcutsDialogGtk::CreateDialogBox(GtkWindow* parent) { gtk_util::GetWidgetSizeFromResources( description_label, IDS_CREATE_SHORTCUTS_DIALOG_WIDTH_CHARS, -1, &label_width, NULL); - label_width -= gtk_util::kControlSpacing * 3 + + label_width -= ui::kControlSpacing * 3 + gdk_pixbuf_get_width(favicon_pixbuf_); gtk_util::SetLabelWidth(description_label, label_width); @@ -243,9 +244,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), gtk_util::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); - GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, ui::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 b9c9f6e..c411452 100644 --- a/chrome/browser/ui/gtk/crypto_module_password_dialog.cc +++ b/chrome/browser/ui/gtk/crypto_module_password_dialog.cc @@ -15,6 +15,7 @@ #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" @@ -167,7 +168,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, gtk_util::kLabelSpacing); + GtkWidget* password_box = gtk_hbox_new(FALSE, ui::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 c501103..74730ab 100644 --- a/chrome/browser/ui/gtk/edit_search_engine_dialog.cc +++ b/chrome/browser/ui/gtk/edit_search_engine_dialog.cc @@ -20,6 +20,7 @@ #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" @@ -207,7 +208,7 @@ void EditSearchEngineDialog::Init(GtkWindow* parent_window, Profile* profile) { FALSE, FALSE, 0); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), - gtk_util::kContentAreaSpacing); + ui::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 889a85e..c9a5806 100644 --- a/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc @@ -15,6 +15,7 @@ #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" @@ -75,9 +76,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), gtk_util::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); - GtkWidget* icon_hbox = gtk_hbox_new(FALSE, gtk_util::kContentAreaSpacing); + GtkWidget* icon_hbox = gtk_hbox_new(FALSE, ui::kContentAreaSpacing); gtk_box_pack_start(GTK_BOX(content_area), icon_hbox, TRUE, TRUE, 0); // Resize the icon if necessary. @@ -97,7 +98,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, gtk_util::kControlSpacing); + GtkWidget* right_column_area = gtk_vbox_new(FALSE, ui::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 04e16eb..583805d 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), gtk_util::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); - GtkWidget* icon_hbox = gtk_hbox_new(FALSE, gtk_util::kContentAreaSpacing); + GtkWidget* icon_hbox = gtk_hbox_new(FALSE, ui::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 6d26a0b..ab178b5 100644 --- a/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc @@ -17,6 +17,7 @@ #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" @@ -79,9 +80,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, gtk_util::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); gtk_container_set_border_width(GTK_CONTAINER(vbox), - gtk_util::kContentAreaBorder); + ui::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 1faed02..527d825 100644 --- a/chrome/browser/ui/gtk/find_bar_gtk.cc +++ b/chrome/browser/ui/gtk/find_bar_gtk.cc @@ -41,6 +41,7 @@ #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" @@ -48,11 +49,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 = gtk_util::kGdkBlack; +const GdkColor kEntryTextColor = ui::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 = gtk_util::kGdkWhite; +const GdkColor kEntryBackgroundColor = ui::kGdkWhite; const GdkColor kFindFailureBackgroundColor = GDK_COLOR_RGB(255, 102, 102); const GdkColor kFindSuccessTextColor = GDK_COLOR_RGB(178, 178, 178); @@ -501,7 +502,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_, >k_util::kGdkBlack, >k_util::kGdkGray); + text_entry_, &ui::kGdkBlack, &ui::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 86c6f42..aacc0fe 100644 --- a/chrome/browser/ui/gtk/first_run_bubble.cc +++ b/chrome/browser/ui/gtk/first_run_bubble.cc @@ -17,6 +17,7 @@ #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 { @@ -101,7 +102,7 @@ FirstRunBubble::~FirstRunBubble() { void FirstRunBubble::InitializeContentForLarge( std::vector<GtkWidget*>* labels) { - GtkWidget* label1 = theme_service_->BuildLabel("", gtk_util::kGdkBlack); + GtkWidget* label1 = theme_service_->BuildLabel("", ui::kGdkBlack); labels->push_back(label1); char* markup = g_markup_printf_escaped(kSearchLabelMarkup, l10n_util::GetStringUTF8(IDS_FR_BUBBLE_TITLE).c_str()); @@ -109,13 +110,13 @@ void FirstRunBubble::InitializeContentForLarge( g_free(markup); GtkWidget* label2 = theme_service_->BuildLabel( - l10n_util::GetStringUTF8(IDS_FR_BUBBLE_SUBTEXT), gtk_util::kGdkBlack); + l10n_util::GetStringUTF8(IDS_FR_BUBBLE_SUBTEXT), ui::kGdkBlack); labels->push_back(label2); string16 search_engine = GetDefaultSearchEngineName(profile_); GtkWidget* label3 = theme_service_->BuildLabel( l10n_util::GetStringFUTF8(IDS_FR_BUBBLE_QUESTION, search_engine), - gtk_util::kGdkBlack); + ui::kGdkBlack); labels->push_back(label3); GtkWidget* keep_button = gtk_button_new_with_label( @@ -154,7 +155,7 @@ void FirstRunBubble::InitializeContentForOEM(std::vector<GtkWidget*>* labels) { void FirstRunBubble::InitializeContentForMinimal( std::vector<GtkWidget*>* labels) { - GtkWidget* label1 = theme_service_->BuildLabel("", gtk_util::kGdkBlack); + GtkWidget* label1 = theme_service_->BuildLabel("", ui::kGdkBlack); labels->push_back(label1); char* markup = g_markup_printf_escaped(kSearchLabelMarkup, l10n_util::GetStringFUTF8( @@ -164,7 +165,7 @@ void FirstRunBubble::InitializeContentForMinimal( g_free(markup); GtkWidget* label2 = theme_service_->BuildLabel( - l10n_util::GetStringUTF8(IDS_FR_BUBBLE_SUBTEXT), gtk_util::kGdkBlack); + l10n_util::GetStringUTF8(IDS_FR_BUBBLE_SUBTEXT), ui::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 3b6fb88..2143681 100644 --- a/chrome/browser/ui/gtk/first_run_dialog.cc +++ b/chrome/browser/ui/gtk/first_run_dialog.cc @@ -29,6 +29,7 @@ #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" @@ -78,8 +79,8 @@ void SetWelcomePosition(GtkFloatingContainer* container, gtk_widget_size_request(label, &req); int x = base::i18n::IsRTL() ? - allocation->width - req.width - gtk_util::kContentAreaSpacing : - gtk_util::kContentAreaSpacing; + allocation->width - req.width - ui::kContentAreaSpacing : + ui::kContentAreaSpacing; g_value_set_int(&value, x); gtk_container_child_set_property(GTK_CONTAINER(container), label, "x", &value); @@ -213,18 +214,18 @@ void FirstRunDialog::ShowSearchEngineWindow() { GtkWidget* bubble_area_background = gtk_event_box_new(); gtk_widget_modify_bg(bubble_area_background, - GTK_STATE_NORMAL, >k_util::kGdkWhite); + GTK_STATE_NORMAL, &ui::kGdkWhite); GtkWidget* bubble_area_box = gtk_vbox_new(FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(bubble_area_box), - gtk_util::kContentAreaSpacing); + ui::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, >k_util::kGdkBlack); + gtk_util::SetLabelColor(explanation, &ui::kGdkBlack); gtk_util::SetLabelWidth(explanation, kExplanationWidth); gtk_box_pack_start(GTK_BOX(bubble_area_box), explanation, FALSE, FALSE, 0); @@ -327,7 +328,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, gtk_util::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, ui::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 8197fd26..a7dcd12 100644 --- a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc @@ -10,6 +10,7 @@ #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( @@ -43,9 +44,9 @@ void FullscreenExitBubbleGtk::InitWidgets() { signals_.Connect(link, "clicked", G_CALLBACK(OnLinkClickedThunk), this); link_container_.Own(gtk_util::CreateGtkBorderBin( - link, >k_util::kGdkBlack, + link, &ui::kGdkBlack, kPaddingPx, kPaddingPx, kPaddingPx, kPaddingPx)); - gtk_util::ActAsRoundedWindow(link_container_.get(), gtk_util::kGdkGreen, + gtk_util::ActAsRoundedWindow(link_container_.get(), ui::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 c44ab46..b6b5ed3 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, - gtk_util::kLabelSpacing); + ui::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, - gtk_util::kLabelSpacing); + ui::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, - gtk_util::kLabelSpacing); + ui::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, - gtk_util::kLabelSpacing); + ui::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, - gtk_util::kLabelSpacing); + ui::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, - gtk_util::kLabelSpacing); + ui::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, - gtk_util::kLabelSpacing); + ui::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, - gtk_util::kLabelSpacing); + ui::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 a3d58da..cab2f69 100644 --- a/chrome/browser/ui/gtk/gtk_theme_service.cc +++ b/chrome/browser/ui/gtk/gtk_theme_service.cc @@ -36,6 +36,7 @@ #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" @@ -238,9 +239,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) * kSkiaToGDKMultiplier; - frame_color->green = SkColorGetG(shifted) * kSkiaToGDKMultiplier; - frame_color->blue = SkColorGetB(shifted) * kSkiaToGDKMultiplier; + frame_color->red = SkColorGetR(shifted) * ui::kSkiaToGDKMultiplier; + frame_color->green = SkColorGetG(shifted) * ui::kSkiaToGDKMultiplier; + frame_color->blue = SkColorGetB(shifted) * ui::kSkiaToGDKMultiplier; } } // namespace diff --git a/chrome/browser/ui/gtk/gtk_util.cc b/chrome/browser/ui/gtk/gtk_util.cc index 2a8160d..ecfbe15 100644 --- a/chrome/browser/ui/gtk/gtk_util.cc +++ b/chrome/browser/ui/gtk/gtk_util.cc @@ -35,6 +35,7 @@ #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" @@ -208,18 +209,13 @@ 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, kLabelSpacing); - gtk_table_set_row_spacings(GTK_TABLE(table), kControlSpacing); + gtk_table_set_col_spacing(GTK_TABLE(table), 0, ui::kLabelSpacing); + gtk_table_set_row_spacings(GTK_TABLE(table), ui::kControlSpacing); for (guint row = 0; text; ++row) { gtk_table_resize(GTK_TABLE(table), row + 1, 2); @@ -666,7 +662,7 @@ GtkWidget* BuildDialogButton(GtkWidget* dialog, int ids_id, } GtkWidget* CreateEntryImageHBox(GtkWidget* entry, GtkWidget* image) { - GtkWidget* hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); + GtkWidget* hbox = gtk_hbox_new(FALSE, ui::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; @@ -682,7 +678,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, - gtk_util::kGroupIndent, 0); + ui::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 3347f1f..f12c727 100644 --- a/chrome/browser/ui/gtk/gtk_util.h +++ b/chrome/browser/ui/gtk/gtk_util.h @@ -27,14 +27,6 @@ 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. @@ -46,32 +38,6 @@ 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 8b6ab75..9003115 100644 --- a/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc @@ -20,6 +20,7 @@ #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" @@ -100,7 +101,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), gtk_util::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); GtkWidget* hbox = gtk_hbox_new(FALSE, 12); gtk_box_pack_start(GTK_BOX(content_area), hbox, TRUE, TRUE, 0); @@ -113,7 +114,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, gtk_util::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, ui::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 4df1394..51741c6 100644 --- a/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc @@ -13,6 +13,7 @@ #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 { @@ -48,7 +49,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), gtk_util::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), ui::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 a8f0b36..c32ce9b 100644 --- a/chrome/browser/ui/gtk/importer/import_progress_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/importer/import_progress_dialog_gtk.cc @@ -14,6 +14,7 @@ #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 { @@ -82,9 +83,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), gtk_util::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); - GtkWidget* control_group = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); + GtkWidget* control_group = gtk_vbox_new(FALSE, ui::kControlSpacing); GtkWidget* import_info = gtk_label_new( l10n_util::GetStringFUTF8(IDS_IMPORT_PROGRESS_INFO, @@ -92,7 +93,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, gtk_util::kControlSpacing); + GtkWidget* item_box = gtk_vbox_new(FALSE, ui::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 d48ebb0..df3ccd9 100644 --- a/chrome/browser/ui/gtk/infobars/after_translate_infobar_gtk.cc +++ b/chrome/browser/ui/gtk/infobars/after_translate_infobar_gtk.cc @@ -9,6 +9,7 @@ #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( @@ -30,7 +31,7 @@ void AfterTranslateInfoBar::Init() { &strings, &swapped_language_combos); DCHECK(strings.size() == 3U); - GtkWidget* hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); + GtkWidget* hbox = gtk_hbox_new(FALSE, ui::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 8bfb29c..02ba8dd 100644 --- a/chrome/browser/ui/gtk/infobars/before_translate_infobar_gtk.cc +++ b/chrome/browser/ui/gtk/infobars/before_translate_infobar_gtk.cc @@ -8,6 +8,7 @@ #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( @@ -22,7 +23,7 @@ BeforeTranslateInfoBar::~BeforeTranslateInfoBar() { void BeforeTranslateInfoBar::Init() { TranslateInfoBarBase::Init(); - GtkWidget* hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); + GtkWidget* hbox = gtk_hbox_new(FALSE, ui::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 c1ad824..38f7f48 100644 --- a/chrome/browser/ui/gtk/infobars/infobar_gtk.cc +++ b/chrome/browser/ui/gtk/infobars/infobar_gtk.cc @@ -15,6 +15,7 @@ #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" @@ -112,7 +113,7 @@ int InfoBarGtk::AnimatingHeight() const { } GtkWidget* InfoBarGtk::CreateLabel(const std::string& text) { - return theme_service_->BuildLabel(text, gtk_util::kGdkBlack); + return theme_service_->BuildLabel(text, ui::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 7ecbc16..c7754fe 100644 --- a/chrome/browser/ui/gtk/infobars/translate_message_infobar_gtk.cc +++ b/chrome/browser/ui/gtk/infobars/translate_message_infobar_gtk.cc @@ -7,6 +7,7 @@ #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, @@ -20,7 +21,7 @@ TranslateMessageInfoBar::~TranslateMessageInfoBar() { void TranslateMessageInfoBar::Init() { TranslateInfoBarBase::Init(); - GtkWidget* hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); + GtkWidget* hbox = gtk_hbox_new(FALSE, ui::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 0cdf899..24881eb 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, gtk_util::kControlSpacing); + gtk_box_set_spacing(vbox, ui::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 a133944..27613f4 100644 --- a/chrome/browser/ui/gtk/location_bar_view_gtk.cc +++ b/chrome/browser/ui/gtk/location_bar_view_gtk.cc @@ -60,6 +60,7 @@ #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" @@ -223,9 +224,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("", gtk_util::kGdkBlack); + theme_service_->BuildLabel("", ui::kGdkBlack); tab_to_search_partial_label_ = - theme_service_->BuildLabel("", gtk_util::kGdkBlack); + theme_service_->BuildLabel("", ui::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 f9717fa..2f64273 100644 --- a/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc +++ b/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc @@ -38,6 +38,7 @@ #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" @@ -317,7 +318,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_, gtk_util::kGdkBlack, 3, + gtk_util::ActAsRoundedWindow(frame_container_, ui::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 a3a85ed..4c3fa32 100644 --- a/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc +++ b/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc @@ -28,6 +28,7 @@ #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 60d79f4..cf72fbb 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 "chrome/browser/ui/gtk/gtk_util.h" +#include "ui/base/gtk/gtk_hig_constants.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 b80d8a3f..f16d3fa 100644 --- a/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc +++ b/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc @@ -33,6 +33,7 @@ #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" @@ -968,7 +969,7 @@ void OmniboxViewGtk::SetBaseColor() { background_color_ptr = &LocationBarViewGtk::kBackgroundColor; #endif gtk_widget_modify_cursor( - text_view_, >k_util::kGdkBlack, >k_util::kGdkGray); + text_view_, &ui::kGdkBlack, &ui::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 58cac1a..4462e28 100644 --- a/chrome/browser/ui/gtk/page_info_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/page_info_bubble_gtk.cc @@ -25,6 +25,7 @@ #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; @@ -138,9 +139,9 @@ void PageInfoBubbleGtk::BubbleClosing(BubbleGtk* bubble, void PageInfoBubbleGtk::InitContents() { if (!contents_) { - contents_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaSpacing); + contents_ = gtk_vbox_new(FALSE, ui::kContentAreaSpacing); gtk_container_set_border_width(GTK_CONTAINER(contents_), - gtk_util::kContentAreaBorder); + ui::kContentAreaBorder); } else { gtk_util::RemoveAllChildren(contents_); } @@ -168,7 +169,7 @@ void PageInfoBubbleGtk::InitContents() { GtkWidget* PageInfoBubbleGtk::CreateSection( const PageInfoModel::SectionInfo& section) { - GtkWidget* section_box = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); + GtkWidget* section_box = gtk_hbox_new(FALSE, ui::kControlSpacing); GdkPixbuf* pixbuf = *model_.GetIconImage(section.icon_id); if (pixbuf) { @@ -177,12 +178,12 @@ GtkWidget* PageInfoBubbleGtk::CreateSection( gtk_misc_set_alignment(GTK_MISC(image), 0, 0); } - GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); + GtkWidget* vbox = gtk_vbox_new(FALSE, ui::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), gtk_util::kGdkBlack); + UTF16ToUTF8(section.headline), ui::kGdkBlack); gtk_label_set_selectable(GTK_LABEL(label), TRUE); PangoAttrList* attributes = pango_attr_list_new(); pango_attr_list_insert(attributes, @@ -196,7 +197,7 @@ GtkWidget* PageInfoBubbleGtk::CreateSection( gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); } GtkWidget* label = theme_service_->BuildLabel( - UTF16ToUTF8(section.description), gtk_util::kGdkBlack); + UTF16ToUTF8(section.description), ui::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 cdf2db9..39d576c 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, gtk_util::kContentAreaBorder); - gtk_box_set_spacing(GTK_BOX(dialog_), gtk_util::kContentAreaSpacing); + dialog_ = gtk_vbox_new(FALSE, ui::kContentAreaBorder); + gtk_box_set_spacing(GTK_BOX(dialog_), ui::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, gtk_util::kControlSpacing); + GtkWidget *hbox = gtk_hbox_new(FALSE, ui::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), gtk_util::kControlSpacing); + gtk_box_set_spacing(GTK_BOX(buttonBox), ui::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 ad01d9b..d818729 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 = gtk_util::kGdkWhite; + GdkColor white = ui::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), - >k_util::kGdkWhite); + &ui::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 84a76aa..11e9b7d 100644 --- a/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc +++ b/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc @@ -22,6 +22,7 @@ #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" @@ -104,9 +105,9 @@ SSLClientCertificateSelector::SSLClientCertificateSelector( delegate_(delegate), parent_(parent), window_(NULL) { - root_widget_.Own(gtk_vbox_new(FALSE, gtk_util::kControlSpacing)); + root_widget_.Own(gtk_vbox_new(FALSE, ui::kControlSpacing)); - GtkWidget* site_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); + GtkWidget* site_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); gtk_box_pack_start(GTK_BOX(root_widget_.get()), site_vbox, FALSE, FALSE, 0); @@ -120,7 +121,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, gtk_util::kControlSpacing); + GtkWidget* selector_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); gtk_box_pack_start(GTK_BOX(root_widget_.get()), selector_vbox, TRUE, TRUE, 0); @@ -159,7 +160,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), gtk_util::kControlSpacing); + gtk_box_set_spacing(GTK_BOX(button_box), ui::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 6ca3435..df31d84 100644 --- a/chrome/browser/ui/gtk/status_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/status_bubble_gtk.cc @@ -18,6 +18,7 @@ #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 { @@ -259,7 +260,7 @@ void StatusBubbleGtk::InitWidgets() { container_.Own(gtk_event_box_new()); gtk_widget_set_no_show_all(container_.get(), TRUE); gtk_util::ActAsRoundedWindow( - container_.get(), gtk_util::kGdkWhite, kCornerSize, + container_.get(), ui::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 cf908f8..ba434b1 100644 --- a/chrome/browser/ui/gtk/task_manager_gtk.cc +++ b/chrome/browser/ui/gtk/task_manager_gtk.cc @@ -29,6 +29,7 @@ #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" @@ -498,7 +499,7 @@ void TaskManagerGtk::Init() { ConnectAccelerators(); gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), - gtk_util::kContentAreaSpacing); + ui::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 604f899..b3df29a 100644 --- a/chrome/browser/ui/gtk/theme_install_bubble_view_gtk.cc +++ b/chrome/browser/ui/gtk/theme_install_bubble_view_gtk.cc @@ -11,6 +11,7 @@ #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. @@ -97,7 +98,7 @@ void ThemeInstallBubbleViewGtk::InitWidgets() { gtk_label_set_markup(GTK_LABEL(label), markup); g_free(markup); - gtk_widget_modify_fg(label, GTK_STATE_NORMAL, >k_util::kGdkWhite); + gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &ui::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 @@ -122,7 +123,7 @@ void ThemeInstallBubbleViewGtk::InitWidgets() { G_CALLBACK(OnExposeThunk), this); gtk_widget_realize(widget_); } else { - gtk_widget_modify_bg(widget_, GTK_STATE_NORMAL, >k_util::kGdkBlack); + gtk_widget_modify_bg(widget_, GTK_STATE_NORMAL, &ui::kGdkBlack); GdkColor color; gtk_util::ActAsRoundedWindow(widget_, color, kBubbleCornerRadius, gtk_util::ROUNDED_ALL, gtk_util::BORDER_NONE); diff --git a/chrome/browser/ui/login/login_prompt_gtk.cc b/chrome/browser/ui/login/login_prompt_gtk.cc index 00a3f99..6e35c90 100644 --- a/chrome/browser/ui/login/login_prompt_gtk.cc +++ b/chrome/browser/ui/login/login_prompt_gtk.cc @@ -20,6 +20,7 @@ #include "content/browser/tab_contents/tab_contents_delegate.h" #include "grit/generated_resources.h" #include "net/url_request/url_request.h" +#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/gtk/gtk_signal.h" #include "ui/base/l10n/l10n_util.h" @@ -67,7 +68,7 @@ class LoginHandlerGtk : public LoginHandler, const string16& explanation) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - root_.Own(gtk_vbox_new(FALSE, gtk_util::kContentAreaBorder)); + root_.Own(gtk_vbox_new(FALSE, ui::kContentAreaBorder)); GtkWidget* label = gtk_label_new(UTF16ToUTF8(explanation).c_str()); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_box_pack_start(GTK_BOX(root_.get()), label, FALSE, FALSE, 0); diff --git a/chrome/browser/ui/views/constrained_html_delegate_gtk.cc b/chrome/browser/ui/views/constrained_html_delegate_gtk.cc index e63aca4..471d65b 100644 --- a/chrome/browser/ui/views/constrained_html_delegate_gtk.cc +++ b/chrome/browser/ui/views/constrained_html_delegate_gtk.cc @@ -6,11 +6,11 @@ #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/views/tab_contents/tab_contents_container.h" #include "chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h" #include "chrome/browser/ui/webui/html_dialog_ui.h" #include "content/browser/tab_contents/tab_contents.h" +#include "ui/base/gtk/gtk_hig_constants.h" #include "ui/gfx/rect.h" #include "views/widget/native_widget_gtk.h" @@ -29,7 +29,7 @@ class ConstrainedHtmlDelegateGtk : public views::NativeWidgetGtk, virtual HtmlDialogUIDelegate* GetHtmlDialogUIDelegate(); virtual void OnDialogClose(); virtual bool GetBackgroundColor(GdkColor* color) { - *color = gtk_util::kGdkWhite; + *color = ui::kGdkWhite; return true; } |