summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-09 21:34:45 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-09 21:34:45 +0000
commitaa98118241207837dc8015ffaf2f8dbaf2de0687 (patch)
tree62dda906107d14a57161617b2b528bb79c7cd5e7
parent445d4cc80e88320e4bd86068c100520c9025fc63 (diff)
downloadchromium_src-aa98118241207837dc8015ffaf2f8dbaf2de0687.zip
chromium_src-aa98118241207837dc8015ffaf2f8dbaf2de0687.tar.gz
chromium_src-aa98118241207837dc8015ffaf2f8dbaf2de0687.tar.bz2
Wrap Windows functions with ifdef so they are only compiled on windows
Review URL: http://codereview.chromium.org/6213 Patch from icefox. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3132 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/SConscript2
-rw-r--r--webkit/glue/webcursor.cc9
-rw-r--r--webkit/glue/webcursor.h4
3 files changed, 10 insertions, 5 deletions
diff --git a/webkit/glue/SConscript b/webkit/glue/SConscript
index a0a02df..9d75882 100644
--- a/webkit/glue/SConscript
+++ b/webkit/glue/SConscript
@@ -26,6 +26,7 @@ input_files = [
'npruntime_util.cc',
'password_form_dom_manager.cc',
'simple_clipboard_impl.cc',
+ 'webcursor.cc',
'webkit_glue.cc',
'weburlrequest_impl.cc',
]
@@ -69,7 +70,6 @@ if env['PLATFORM'] == 'win32':
'resource_fetcher.cc',
'resource_handle_win.cc',
'searchable_form_data.cc',
- 'webcursor.cc',
'webdatasource_impl.cc',
'webdocumentloader_impl.cc',
'webdropdata.cc',
diff --git a/webkit/glue/webcursor.cc b/webkit/glue/webcursor.cc
index 19b34b0..c00d0d4 100644
--- a/webkit/glue/webcursor.cc
+++ b/webkit/glue/webcursor.cc
@@ -2,10 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/gfx/bitmap_header.h"
#include "webkit/glue/webcursor.h"
#include "webkit/glue/webkit_resources.h"
+#if PLATFORM(WIN)
+#include "base/gfx/bitmap_header.h"
+#endif
+
WebCursor::WebCursor()
: type_(ARROW),
hotspot_x_(0),
@@ -53,7 +56,7 @@ WebCursor& WebCursor::operator=(const WebCursor& other) {
}
return *this;
}
-
+#if PLATFORM(WIN)
HCURSOR WebCursor::GetCursor(HINSTANCE module_handle) const {
if (type_ == CUSTOM)
return NULL;
@@ -132,7 +135,7 @@ HCURSOR WebCursor::GetCustomCursor() const {
::ReleaseDC(0, dc);
return cursor_handle;
}
-
+#endif
bool WebCursor::IsSameBitmap(const SkBitmap& bitmap) const {
SkAutoLockPixels new_bitmap_lock(bitmap);
SkAutoLockPixels bitmap_lock(bitmap_);
diff --git a/webkit/glue/webcursor.h b/webkit/glue/webcursor.h
index a35b604..ba35c2c 100644
--- a/webkit/glue/webcursor.h
+++ b/webkit/glue/webcursor.h
@@ -6,6 +6,7 @@
#define WEBCURSOR_H__
#include "skia/include/SkBitmap.h"
+#include <wtf/Platform.h>
// This class provides the functionality of a generic cursor type. The intent
// is to stay away from platform specific code here. We do have win32 specific
@@ -69,7 +70,7 @@ public:
hotspot_x_ = hotspot_x;
hotspot_y_ = hotspot_x;
}
-
+#if PLATFORM(WIN)
// Returns the cursor handle. If the cursor type is a win32 or safari
// cursor, we use LoadCursor to load the cursor.
// Returns NULL on error.
@@ -79,6 +80,7 @@ public:
// freeing the cursor handle lies with the caller.
// Returns NULL on error.
HCURSOR GetCustomCursor() const;
+#endif
// Returns true if the passed in SkBitmap is the same as the the
// current SkBitmap. We use memcmp to compare the two bitmaps.
bool IsSameBitmap(const SkBitmap& bitmap) const;