Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(722)

Unified Diff: ui/base/resource/resource_bundle_linux.cc

Issue 7977025: aura: Make 'ui' buildable without gtk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/resource/resource_bundle.h ('k') | ui/gfx/canvas_skia.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/resource_bundle_linux.cc
diff --git a/ui/base/resource/resource_bundle_linux.cc b/ui/base/resource/resource_bundle_linux.cc
index 0ea8b0d235f63ae983502e646be45558394acc4d..14000ce28d9e541960bd7a964bb901500360d1a9 100644
--- a/ui/base/resource/resource_bundle_linux.cc
+++ b/ui/base/resource/resource_bundle_linux.cc
@@ -4,8 +4,6 @@
#include "ui/base/resource/resource_bundle.h"
-#include <gtk/gtk.h>
-
#include "base/base_paths.h"
#include "base/file_path.h"
#include "base/file_util.h"
@@ -21,8 +19,13 @@
#include "ui/gfx/gtk_util.h"
#include "ui/gfx/image/image.h"
+#if defined(TOOLKIT_USES_GTK)
+#include <gtk/gtk.h>
+#endif
+
namespace ui {
+#if defined(TOOLKIT_USES_GTK)
namespace {
// Convert the raw image data into a GdkPixbuf. The GdkPixbuf that is returned
@@ -57,6 +60,7 @@ GdkPixbuf* LoadPixbuf(RefCountedStaticMemory* data, bool rtl_enabled) {
}
} // namespace
+#endif // defined(TOOLKIT_USES_GTK)
// static
FilePath ResourceBundle::GetResourcesFilePath() {
@@ -72,9 +76,15 @@ FilePath ResourceBundle::GetLargeIconResourcesFilePath() {
}
gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id) {
+#if defined(TOOLKIT_USES_GTK)
return *GetPixbufImpl(resource_id, false);
+#else
+ static gfx::Image image(NULL);
+ return image;
+#endif
}
+#if defined(TOOLKIT_USES_GTK)
gfx::Image* ResourceBundle::GetPixbufImpl(int resource_id, bool rtl_enabled) {
// Use the negative |resource_id| for the key for BIDI-aware images.
int key = rtl_enabled ? -resource_id : resource_id;
@@ -114,5 +124,6 @@ gfx::Image* ResourceBundle::GetPixbufImpl(int resource_id, bool rtl_enabled) {
GdkPixbuf* ResourceBundle::GetRTLEnabledPixbufNamed(int resource_id) {
return *GetPixbufImpl(resource_id, true);
}
+#endif // defined(TOOLKIT_USES_GTK)
} // namespace ui
« no previous file with comments | « ui/base/resource/resource_bundle.h ('k') | ui/gfx/canvas_skia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698