Commit 1e19a83d authored by pfeldman@chromium.org's avatar pfeldman@chromium.org

2010-04-05 Pavel Feldman <pfeldman@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: [REGRESSION] platform detection in Chromium
        has regressed to unknown.

        https://bugs.webkit.org/show_bug.cgi?id=37081

        * bindings/js/JSInspectorFrontendHostCustom.cpp:
        (WebCore::JSInspectorFrontendHost::platform):
        (WebCore::JSInspectorFrontendHost::port):
        * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
        (WebCore::V8InspectorFrontendHost::platform):
        (WebCore::V8InspectorFrontendHost::port):
        * inspector/InspectorFrontendHost.cpp:
        * inspector/InspectorFrontendHost.h:
        * inspector/InspectorFrontendHost.idl:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@57069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8624fd2a
2010-04-05 Pavel Feldman <pfeldman@chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: [REGRESSION] platform detection in Chromium
has regressed to unknown.
https://bugs.webkit.org/show_bug.cgi?id=37081
* bindings/js/JSInspectorFrontendHostCustom.cpp:
(WebCore::JSInspectorFrontendHost::platform):
(WebCore::JSInspectorFrontendHost::port):
* bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
(WebCore::V8InspectorFrontendHost::platform):
(WebCore::V8InspectorFrontendHost::port):
* inspector/InspectorFrontendHost.cpp:
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:
2010-04-05 Andrey Kosyakov <caseq@chromium.org>
Reviewed by Yury Semikhatsky.
......@@ -49,6 +49,34 @@ 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)
......
......@@ -40,6 +40,24 @@
namespace WebCore {
v8::Handle<v8::Value> V8InspectorFrontendHost::platform(const v8::Arguments&)
{
#if defined(OS_MACOSX)
return v8String("mac");
#elif defined(OS_LINUX)
return v8String("linux");
#elif defined(OS_WIN)
return v8String("windows");
#else
return v8String("unknown");
#endif
}
v8::Handle<v8::Value> V8InspectorFrontendHost::port(const v8::Arguments&)
{
return v8::Undefined();
}
v8::Handle<v8::Value> V8InspectorFrontendHost::showContextMenuCallback(const v8::Arguments& args)
{
if (args.Length() < 2)
......
......@@ -201,35 +201,6 @@ String InspectorFrontendHost::hiddenPanels()
return m_client->hiddenPanels();
}
const String& InspectorFrontendHost::platform() const
{
#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 platform;
}
const String& InspectorFrontendHost::port() const
{
#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 port;
}
void InspectorFrontendHost::copyText(const String& text)
{
Pasteboard::generalPasteboard()->writePlainText(text);
......
......@@ -71,8 +71,6 @@ public:
String localizedStringsURL();
String hiddenPanels();
const String& platform() const;
const String& port() const;
void copyText(const String& text);
......
......@@ -45,11 +45,11 @@ module core {
DOMString localizedStringsURL();
DOMString hiddenPanels();
DOMString platform();
DOMString port();
void copyText(in DOMString text);
[Custom] DOMString platform();
[Custom] DOMString port();
[Custom] void showContextMenu(in MouseEvent event, in DOMObject items);
};
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment