summaryrefslogtreecommitdiffstats
path: root/webkit/glue/event_conversion.cc
diff options
context:
space:
mode:
authordarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-18 05:08:12 +0000
committerdarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-18 05:08:12 +0000
commitccc813c26cdbbdb4c71f62779f6a5f2d25be93bb (patch)
tree4c0319edcc82085784e9ecf561518f0aefa0b8af /webkit/glue/event_conversion.cc
parenta27c729249f611af09d22f1999b9d0f190e4f68d (diff)
downloadchromium_src-ccc813c26cdbbdb4c71f62779f6a5f2d25be93bb.zip
chromium_src-ccc813c26cdbbdb4c71f62779f6a5f2d25be93bb.tar.gz
chromium_src-ccc813c26cdbbdb4c71f62779f6a5f2d25be93bb.tar.bz2
Update to pick up PLATFORM(MAC) and add some ifdefs in event_conversion.cc
TBR=tony Review URL: http://codereview.chromium.org/7508 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3591 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/event_conversion.cc')
-rw-r--r--webkit/glue/event_conversion.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/webkit/glue/event_conversion.cc b/webkit/glue/event_conversion.cc
index 8c56892..2421c3c 100644
--- a/webkit/glue/event_conversion.cc
+++ b/webkit/glue/event_conversion.cc
@@ -13,13 +13,9 @@
#include "StringImpl.h" // This is so that the KJS build works
MSVC_PUSH_WARNING_LEVEL(0);
-// HACK: make it possible to initialize these classes...
-// TODO(darin): send this change to webkit.org
-#define private protected
#include "PlatformKeyboardEvent.h"
#include "PlatformMouseEvent.h"
#include "PlatformWheelEvent.h"
-#undef private
#include "Widget.h"
MSVC_POP_WARNING();
@@ -165,6 +161,7 @@ static inline const PlatformKeyboardEvent::Type ToPlatformKeyboardEventType(
return PlatformKeyboardEvent::KeyDown;
}
+#if defined(OS_WIN)
static inline String ToSingleCharacterString(UChar c) {
return String(&c, 1);
}
@@ -271,6 +268,7 @@ static String GetKeyIdentifierForWindowsKeyCode(unsigned short keyCode) {
return String::format("U+%04X", toupper(keyCode));
}
}
+#endif
MakePlatformKeyboardEvent::MakePlatformKeyboardEvent(const WebKeyboardEvent& e)
#if defined(OS_WIN)
@@ -280,6 +278,7 @@ MakePlatformKeyboardEvent::MakePlatformKeyboardEvent(const WebKeyboardEvent& e)
#elif defined(OS_LINUX)
: PlatformKeyboardEvent(NULL) {
#endif
+#if defined(OS_WIN)
m_type = ToPlatformKeyboardEventType(e.type);
if (m_type == Char || m_type == KeyDown)
m_text = m_unmodifiedText = ToSingleCharacterString(e.key_code);
@@ -291,13 +290,14 @@ MakePlatformKeyboardEvent::MakePlatformKeyboardEvent(const WebKeyboardEvent& e)
} else {
m_windowsVirtualKeyCode = 0;
}
+ m_isSystemKey = e.system_key;
+#endif
m_autoRepeat = (e.modifiers & WebInputEvent::IS_AUTO_REPEAT) != 0;
m_isKeypad = (e.modifiers & WebInputEvent::IS_KEYPAD) != 0;
m_shiftKey = (e.modifiers & WebInputEvent::SHIFT_KEY) != 0;
m_ctrlKey = (e.modifiers & WebInputEvent::CTRL_KEY) != 0;
m_altKey = (e.modifiers & WebInputEvent::ALT_KEY) != 0;
m_metaKey = (e.modifiers & WebInputEvent::META_KEY) != 0;
- m_isSystemKey = e.system_key;
}
void MakePlatformKeyboardEvent::SetKeyType(Type type) {