summaryrefslogtreecommitdiffstats
path: root/app/clipboard
diff options
context:
space:
mode:
authorpvalchev@google.com <pvalchev@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-23 01:37:15 +0000
committerpvalchev@google.com <pvalchev@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-23 01:37:15 +0000
commitb05be39e20ae9d70bc54c7511d8199517294a2dd (patch)
tree24750b9f4e7ce4061740c08027cea3855572c1af /app/clipboard
parent53adb9a6d5c506d8df8a08adc092acd524a79753 (diff)
downloadchromium_src-b05be39e20ae9d70bc54c7511d8199517294a2dd.zip
chromium_src-b05be39e20ae9d70bc54c7511d8199517294a2dd.tar.gz
chromium_src-b05be39e20ae9d70bc54c7511d8199517294a2dd.tar.bz2
OpenBSD/FreeBSD ifdefs and GYP changes for app/ directory
- Use OS_POSIX && !OS_MACOSX defines to capture Linux/*BSD as they have many similarities, use other defines instead of OS_LINUX where sensible. Based on original work by Sprewell and Ben Laurie on FreeBSD port Review URL: http://codereview.chromium.org/548126 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36931 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/clipboard')
-rw-r--r--app/clipboard/clipboard.cc4
-rw-r--r--app/clipboard/clipboard.h14
-rw-r--r--app/clipboard/clipboard_unittest.cc4
3 files changed, 11 insertions, 11 deletions
diff --git a/app/clipboard/clipboard.cc b/app/clipboard/clipboard.cc
index 4103c3a..a2050a0 100644
--- a/app/clipboard/clipboard.cc
+++ b/app/clipboard/clipboard.cc
@@ -67,12 +67,12 @@ void Clipboard::DispatchObject(ObjectType type, const ObjectMapParams& params) {
WriteBitmap(&(params[0].front()), &(params[1].front()));
break;
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if !defined(OS_MACOSX)
case CBF_DATA:
WriteData(&(params[0].front()), params[0].size(),
&(params[1].front()), params[1].size());
break;
-#endif // defined(OS_WIN) || defined(OS_LINUX)
+#endif // !defined(OS_MACOSX)
default:
NOTREACHED();
diff --git a/app/clipboard/clipboard.h b/app/clipboard/clipboard.h
index 80a35e6..faaa00c 100644
--- a/app/clipboard/clipboard.h
+++ b/app/clipboard/clipboard.h
@@ -76,7 +76,7 @@ class Clipboard {
// functions accept a buffer parameter.
enum Buffer {
BUFFER_STANDARD,
-#if defined(OS_LINUX)
+#if defined(USE_X11)
BUFFER_SELECTION,
#endif
};
@@ -85,7 +85,7 @@ class Clipboard {
switch (buffer) {
case BUFFER_STANDARD:
return true;
-#if defined(OS_LINUX)
+#if defined(USE_X11)
case BUFFER_SELECTION:
return true;
#endif
@@ -112,11 +112,11 @@ class Clipboard {
// can use.
void WriteObjects(const ObjectMap& objects, base::ProcessHandle process);
- // On Linux, we need to know when the clipboard is set to a URL. Most
+ // On Linux/BSD, we need to know when the clipboard is set to a URL. Most
// platforms don't care.
-#if !defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_MACOSX)
void DidWriteURL(const std::string& utf8_text) {}
-#else // !defined(OS_LINUX)
+#else // !defined(OS_WIN) && !defined(OS_MACOSX)
void DidWriteURL(const std::string& utf8_text);
#endif
@@ -193,7 +193,7 @@ class Clipboard {
void WriteBitmap(const char* pixel_data, const char* size_data);
-#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_FREEBSD)
+#if !defined(OS_MACOSX)
// |format_name| is an ASCII string and should be NULL-terminated.
// TODO(estade): port to mac.
void WriteData(const char* format_name, size_t format_len,
@@ -226,7 +226,7 @@ class Clipboard {
// True if we can create a window.
bool create_window_;
-#elif defined(USE_X11)
+#elif !defined(OS_MACOSX)
// The public API is via WriteObjects() which dispatches to multiple
// Write*() calls, but on GTK we must write all the clipboard types
// in a single GTK call. To support this we store the current set
diff --git a/app/clipboard/clipboard_unittest.cc b/app/clipboard/clipboard_unittest.cc
index 6f19d97..81f400d 100644
--- a/app/clipboard/clipboard_unittest.cc
+++ b/app/clipboard/clipboard_unittest.cc
@@ -130,7 +130,7 @@ TEST_F(ClipboardTest, TrickyHTMLTest) {
}
// TODO(estade): Port the following test (decide what target we use for urls)
-#if !defined(OS_LINUX)
+#if !defined(OS_POSIX) || defined(OS_MACOSX)
TEST_F(ClipboardTest, BookmarkTest) {
Clipboard clipboard;
@@ -213,7 +213,7 @@ TEST_F(ClipboardTest, URLTest) {
#endif // defined(OS_LINUX)
}
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX))
TEST_F(ClipboardTest, DataTest) {
Clipboard clipboard;
const char* format = "chromium/x-test-format";