summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/API/C/WKInspector.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebKit2/UIProcess/API/C/WKInspector.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebKit2/UIProcess/API/C/WKInspector.cpp')
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKInspector.cpp130
1 files changed, 17 insertions, 113 deletions
diff --git a/Source/WebKit2/UIProcess/API/C/WKInspector.cpp b/Source/WebKit2/UIProcess/API/C/WKInspector.cpp
index e638609bb..aeb8d57cb 100644
--- a/Source/WebKit2/UIProcess/API/C/WKInspector.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKInspector.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,205 +26,109 @@
#include "config.h"
#include "WKInspector.h"
+#if !PLATFORM(IOS)
+
#include "WKAPICast.h"
#include "WebInspectorProxy.h"
+#include "WebPageProxy.h"
using namespace WebKit;
WKTypeID WKInspectorGetTypeID()
{
-#if ENABLE(INSPECTOR)
return toAPI(WebInspectorProxy::APIType);
-#else
- return 0;
-#endif
}
WKPageRef WKInspectorGetPage(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
- return toAPI(toImpl(inspectorRef)->page());
-#else
- UNUSED_PARAM(inspectorRef);
- return 0;
-#endif
+ return toAPI(toImpl(inspectorRef)->inspectedPage());
}
bool WKInspectorIsConnected(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
return toImpl(inspectorRef)->isConnected();
-#else
- UNUSED_PARAM(inspectorRef);
- return false;
-#endif
}
bool WKInspectorIsVisible(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
return toImpl(inspectorRef)->isVisible();
-#else
- UNUSED_PARAM(inspectorRef);
- return false;
-#endif
}
bool WKInspectorIsFront(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
return toImpl(inspectorRef)->isFront();
-#else
- UNUSED_PARAM(inspectorRef);
- return false;
-#endif
}
void WKInspectorConnect(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
toImpl(inspectorRef)->connect();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
}
void WKInspectorShow(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
toImpl(inspectorRef)->show();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
}
void WKInspectorHide(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
toImpl(inspectorRef)->hide();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
}
void WKInspectorClose(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
toImpl(inspectorRef)->close();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
}
void WKInspectorShowConsole(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
toImpl(inspectorRef)->showConsole();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
}
void WKInspectorShowResources(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
toImpl(inspectorRef)->showResources();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
}
void WKInspectorShowMainResourceForFrame(WKInspectorRef inspectorRef, WKFrameRef frameRef)
{
-#if ENABLE(INSPECTOR)
toImpl(inspectorRef)->showMainResourceForFrame(toImpl(frameRef));
-#else
- UNUSED_PARAM(inspectorRef);
- UNUSED_PARAM(frameRef);
-#endif
}
bool WKInspectorIsAttached(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
return toImpl(inspectorRef)->isAttached();
-#else
- UNUSED_PARAM(inspectorRef);
- return false;
-#endif
}
void WKInspectorAttach(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
- toImpl(inspectorRef)->attach();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
+ auto inspector = toImpl(inspectorRef);
+ inspector->attach(inspector->attachmentSide());
}
void WKInspectorDetach(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
toImpl(inspectorRef)->detach();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
-}
-
-bool WKInspectorIsDebuggingJavaScript(WKInspectorRef inspectorRef)
-{
-#if ENABLE(INSPECTOR)
- return toImpl(inspectorRef)->isDebuggingJavaScript();
-#else
- UNUSED_PARAM(inspectorRef);
- return false;
-#endif
}
-void WKInspectorToggleJavaScriptDebugging(WKInspectorRef inspectorRef)
+bool WKInspectorIsProfilingPage(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
- toImpl(inspectorRef)->toggleJavaScriptDebugging();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
+ return toImpl(inspectorRef)->isProfilingPage();
}
-bool WKInspectorIsProfilingJavaScript(WKInspectorRef inspectorRef)
+void WKInspectorTogglePageProfiling(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
- return toImpl(inspectorRef)->isProfilingJavaScript();
-#else
- UNUSED_PARAM(inspectorRef);
- return false;
-#endif
+ toImpl(inspectorRef)->showTimelines();
+ toImpl(inspectorRef)->togglePageProfiling();
}
-void WKInspectorToggleJavaScriptProfiling(WKInspectorRef inspectorRef)
+bool WKInspectorIsElementSelectionActive(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
- toImpl(inspectorRef)->toggleJavaScriptProfiling();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
+ return toImpl(inspectorRef)->isElementSelectionActive();
}
-bool WKInspectorIsProfilingPage(WKInspectorRef inspectorRef)
+void WKInspectorToggleElementSelection(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
- return toImpl(inspectorRef)->isProfilingPage();
-#else
- UNUSED_PARAM(inspectorRef);
- return false;
-#endif
+ toImpl(inspectorRef)->toggleElementSelection();
}
-void WKInspectorTogglePageProfiling(WKInspectorRef inspectorRef)
-{
-#if ENABLE(INSPECTOR)
- toImpl(inspectorRef)->togglePageProfiling();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
-}
+#endif // !PLATFORM(IOS)