summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-10 15:09:39 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-10 15:09:39 +0000
commit9146221ca83c4996713894316661b442b20c9e28 (patch)
tree0cd1efb863d39a4ac44aacde045c957552e3da7d /base
parent98f5f88b53f774cee109503b0225a5bfb9deb550 (diff)
downloadchromium_src-9146221ca83c4996713894316661b442b20c9e28.zip
chromium_src-9146221ca83c4996713894316661b442b20c9e28.tar.gz
chromium_src-9146221ca83c4996713894316661b442b20c9e28.tar.bz2
Adds some ifdefs so that test_shell can be compiled on linux
without GTK. I had to recreate this patch as my workspace for various resonds. UGH! BUG=none TEST=none Review URL: http://codereview.chromium.org/67024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13503 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/clipboard.h6
-rwxr-xr-xbase/gfx/rect.cc8
-rwxr-xr-xbase/gfx/rect.h12
-rw-r--r--base/message_loop.cc8
4 files changed, 20 insertions, 14 deletions
diff --git a/base/clipboard.h b/base/clipboard.h
index 546c498..0e4363d 100644
--- a/base/clipboard.h
+++ b/base/clipboard.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -18,7 +18,9 @@ class Clipboard {
public:
typedef std::string FormatType;
#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
typedef struct _GtkClipboard GtkClipboard;
+#endif
typedef std::map<FormatType, std::pair<char*, size_t> > TargetMap;
#endif
@@ -195,8 +197,10 @@ class Clipboard {
void InsertMapping(const char* key, char* data, size_t data_len);
TargetMap* clipboard_data_;
+#if defined(TOOLKIT_GTK)
GtkClipboard* clipboard_;
#endif
+#endif
DISALLOW_EVIL_CONSTRUCTORS(Clipboard);
};
diff --git a/base/gfx/rect.cc b/base/gfx/rect.cc
index 3e7d782..003766b 100755
--- a/base/gfx/rect.cc
+++ b/base/gfx/rect.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,7 +8,7 @@
#include <windows.h>
#elif defined(OS_MACOSX)
#include <CoreGraphics/CGGeometry.h>
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
#include <gdk/gdk.h>
#endif
@@ -74,7 +74,7 @@ Rect& Rect::operator=(const CGRect& r) {
set_height(r.size.height);
return *this;
}
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
Rect::Rect(const GdkRectangle& r)
: origin_(r.x, r.y) {
set_width(r.width);
@@ -140,7 +140,7 @@ RECT Rect::ToRECT() const {
r.bottom = bottom();
return r;
}
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
GdkRectangle Rect::ToGdkRectangle() const {
GdkRectangle r = {x(), y(), width(), height()};
return r;
diff --git a/base/gfx/rect.h b/base/gfx/rect.h
index 4428fec..21083b2 100755
--- a/base/gfx/rect.h
+++ b/base/gfx/rect.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -19,9 +19,7 @@
#if defined(OS_WIN)
typedef struct tagRECT RECT;
-#elif defined(OS_LINUX)
-// It's wrong to hide GDK stuff behind OS_LINUX, but until we have a different
-// linux target, this is less complex.
+#elif defined(TOOLKIT_GTK)
typedef struct _GdkRectangle GdkRectangle;
#endif
@@ -36,7 +34,7 @@ class Rect {
explicit Rect(const RECT& r);
#elif defined(OS_MACOSX)
explicit Rect(const CGRect& r);
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
explicit Rect(const GdkRectangle& r);
#endif
Rect(const gfx::Point& origin, const gfx::Size& size);
@@ -47,7 +45,7 @@ class Rect {
Rect& operator=(const RECT& r);
#elif defined(OS_MACOSX)
Rect& operator=(const CGRect& r);
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
Rect& operator=(const GdkRectangle& r);
#endif
@@ -99,7 +97,7 @@ class Rect {
#if defined(OS_WIN)
// Construct an equivalent Win32 RECT object.
RECT ToRECT() const;
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
GdkRectangle ToGdkRectangle() const;
#elif defined(OS_MACOSX)
// Construct an equivalent CoreGraphics object.
diff --git a/base/message_loop.cc b/base/message_loop.cc
index b4ad2bc..d836c92 100644
--- a/base/message_loop.cc
+++ b/base/message_loop.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -19,7 +19,7 @@
#if defined(OS_POSIX)
#include "base/message_pump_libevent.h"
#endif
-#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
#include "base/message_pump_glib.h"
#endif
@@ -99,7 +99,11 @@ MessageLoop::MessageLoop(Type type)
#if defined(OS_MACOSX)
pump_ = base::MessagePumpMac::Create();
#elif defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
pump_ = new base::MessagePumpForUI();
+#else
+ pump_ = new base::MessagePumpDefault();
+#endif
#endif // OS_LINUX
} else if (type_ == TYPE_IO) {
pump_ = new base::MessagePumpLibevent();