Chromium Code Reviews| Index: base/mime_util_xdg.cc |
| diff --git a/base/mime_util_xdg.cc b/base/mime_util_xdg.cc |
| index fcd8d97576c802a60adf9050513383ca21434c0e..1a6b6d872af77ac587815adc5c46f439ee9c4317 100644 |
| --- a/base/mime_util_xdg.cc |
| +++ b/base/mime_util_xdg.cc |
| @@ -4,7 +4,9 @@ |
| #include "base/mime_util.h" |
| +#if defined(TOOLKIT_USES_GTK) |
|
willchan no longer on Chromium
2011/11/10 21:24:14
Unless it needs to be ordered this way, please mov
Daniel Erat
2011/11/10 21:43:25
Done.
|
| #include <gtk/gtk.h> |
| +#endif |
| #include <sys/time.h> |
| #include <time.h> |
| @@ -66,10 +68,12 @@ class MimeUtilConstants { |
| time_t last_check_time_; |
| +#if defined(TOOLKIT_USES_GTK) |
| // This is set by DetectGtkTheme(). We cache it so that we can access the |
| // theme name from threads that aren't allowed to call |
| // gtk_settings_get_default(). |
| std::string gtk_theme_name_; |
| +#endif |
| private: |
| MimeUtilConstants() |
| @@ -507,10 +511,12 @@ void InitDefaultThemes() { |
| default_themes[1] = IconTheme::LoadTheme(kde_default_theme); |
| default_themes[2] = IconTheme::LoadTheme(kde_fallback_theme); |
| } else { |
| +#if defined(TOOLKIT_USES_GTK) |
| // Assume it's Gnome and use GTK to figure out the theme. |
| default_themes[1] = IconTheme::LoadTheme( |
| MimeUtilConstants::GetInstance()->gtk_theme_name_); |
| default_themes[2] = IconTheme::LoadTheme("gnome"); |
| +#endif |
| } |
| // hicolor needs to be last per icon theme spec. |
| default_themes[3] = IconTheme::LoadTheme("hicolor"); |
| @@ -567,6 +573,7 @@ std::string GetDataMimeType(const std::string& data) { |
| return xdg_mime_get_mime_type_for_data(data.data(), data.length(), NULL); |
| } |
| +#if defined(TOOLKIT_USES_GTK) |
| void DetectGtkTheme() { |
| // If the theme name is already loaded, do nothing. Chrome doesn't respond |
| // to changes in the system theme, so we never need to set this more than |
| @@ -584,6 +591,7 @@ void DetectGtkTheme() { |
| MimeUtilConstants::GetInstance()->gtk_theme_name_.assign(gtk_theme_name); |
| g_free(gtk_theme_name); |
| } |
| +#endif |
| FilePath GetMimeIcon(const std::string& mime_type, size_t size) { |
| base::ThreadRestrictions::AssertIOAllowed(); |