summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-04-27 16:31:00 +0100
committerSteve Block <steveblock@google.com>2010-05-11 14:42:12 +0100
commitdcc8cf2e65d1aa555cce12431a16547e66b469ee (patch)
tree92a8d65cd5383bca9749f5327fb5e440563926e6 /WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
parentccac38a6b48843126402088a309597e682f40fe6 (diff)
downloadexternal_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp')
-rw-r--r--WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp35
1 files changed, 33 insertions, 2 deletions
diff --git a/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp b/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
index 7b06bac..d18260b 100644
--- a/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
+++ b/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
@@ -49,11 +49,39 @@ using namespace JSC;
namespace WebCore {
+JSValue JSInspectorFrontendHost::platform(ExecState* execState, const ArgList&)
+{
+#if PLATFORM(MAC)
+ DEFINE_STATIC_LOCAL(const String, platform, ("mac"));
+#elif OS(WINDOWS)
+ DEFINE_STATIC_LOCAL(const String, platform, ("windows"));
+#elif OS(LINUX)
+ DEFINE_STATIC_LOCAL(const String, platform, ("linux"));
+#else
+ DEFINE_STATIC_LOCAL(const String, platform, ("unknown"));
+#endif
+ return jsString(execState, platform);
+}
+
+JSValue JSInspectorFrontendHost::port(ExecState* execState, const ArgList&)
+{
+#if PLATFORM(QT)
+ DEFINE_STATIC_LOCAL(const String, port, ("qt"));
+#elif PLATFORM(GTK)
+ DEFINE_STATIC_LOCAL(const String, port, ("gtk"));
+#elif PLATFORM(WX)
+ DEFINE_STATIC_LOCAL(const String, port, ("wx"));
+#else
+ DEFINE_STATIC_LOCAL(const String, port, ("unknown"));
+#endif
+ return jsString(execState, port);
+}
+
JSValue JSInspectorFrontendHost::showContextMenu(ExecState* execState, const ArgList& args)
{
if (args.size() < 2)
return jsUndefined();
-
+#if ENABLE(CONTEXT_MENUS)
Event* event = toEvent(args.at(0));
JSArray* array = asArray(args.at(1));
@@ -67,11 +95,14 @@ JSValue JSInspectorFrontendHost::showContextMenu(ExecState* execState, const Arg
items.append(new ContextMenuItem(SeparatorType, ContextMenuItemTagNoAction, String()));
else {
ContextMenuAction typedId = static_cast<ContextMenuAction>(ContextMenuItemBaseCustomTag + id.toInt32(execState));
- items.append(new ContextMenuItem(ActionType, typedId, label.toString(execState)));
+ items.append(new ContextMenuItem(ActionType, typedId, ustringToString(label.toString(execState))));
}
}
impl()->showContextMenu(event, items);
+#else
+ UNUSED_PARAM(execState);
+#endif
return jsUndefined();
}