*/
#include "config.h"
-#include "InspectorClientImpl.h"
+#include "web/InspectorClientImpl.h"
-#include "WebDevToolsAgentImpl.h"
-#include "WebViewClient.h"
-#include "WebViewImpl.h"
+#include "core/frame/LocalDOMWindow.h"
+#include "core/frame/LocalFrame.h"
+#include "core/frame/Settings.h"
#include "core/inspector/InspectorInstrumentation.h"
-#include "core/frame/DOMWindow.h"
#include "core/page/Page.h"
-#include "core/frame/Settings.h"
+#include "platform/JSONValues.h"
#include "platform/geometry/FloatRect.h"
#include "public/platform/WebRect.h"
#include "public/platform/WebURL.h"
#include "public/platform/WebURLRequest.h"
-#include "wtf/Vector.h"
-
-using namespace WebCore;
+#include "public/web/WebViewClient.h"
+#include "web/WebDevToolsAgentImpl.h"
+#include "web/WebViewImpl.h"
namespace blink {
agent->hideHighlight();
}
-bool InspectorClientImpl::sendMessageToFrontend(const WTF::String& message)
+void InspectorClientImpl::sendMessageToFrontend(PassRefPtr<JSONObject> message)
+{
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ agent->sendMessageToFrontend(message);
+}
+
+void InspectorClientImpl::flush()
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
- return agent->sendMessageToFrontend(message);
- return false;
+ agent->flush();
}
void InspectorClientImpl::updateInspectorStateCookie(const WTF::String& inspectorState)
agent->updateInspectorStateCookie(inspectorState);
}
-void InspectorClientImpl::clearBrowserCache()
+void InspectorClientImpl::setDeviceMetricsOverride(int width, int height, float deviceScaleFactor, bool mobile, bool fitWindow, float scale, float offsetX, float offsetY)
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
- agent->clearBrowserCache();
+ agent->setDeviceMetricsOverride(width, height, deviceScaleFactor, mobile, fitWindow, scale, offsetX, offsetY);
}
-void InspectorClientImpl::clearBrowserCookies()
+void InspectorClientImpl::clearDeviceMetricsOverride()
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
- agent->clearBrowserCookies();
+ agent->clearDeviceMetricsOverride();
}
-void InspectorClientImpl::overrideDeviceMetrics(int width, int height, float deviceScaleFactor, bool emulateViewport, bool fitWindow)
+void InspectorClientImpl::setTouchEventEmulationEnabled(bool enabled)
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
- agent->overrideDeviceMetrics(width, height, deviceScaleFactor, emulateViewport, fitWindow);
+ agent->setTouchEventEmulationEnabled(enabled);
}
bool InspectorClientImpl::overridesShowPaintRects()
m_inspectedWebView->setShowScrollBottleneckRects(show);
}
-void InspectorClientImpl::requestPageScaleFactor(float scale, const IntPoint& origin)
+void InspectorClientImpl::resetScrollAndPageScaleFactor()
{
- m_inspectedWebView->setPageScaleFactor(scale, origin);
+ m_inspectedWebView->resetScrollAndScaleState();
}
-void InspectorClientImpl::getAllocatedObjects(HashSet<const void*>& set)
+float InspectorClientImpl::minimumPageScaleFactor()
{
- if (WebDevToolsAgentImpl* agent = devToolsAgent())
- agent->getAllocatedObjects(set);
+ return m_inspectedWebView->minimumPageScaleFactor();
}
-void InspectorClientImpl::dumpUncountedAllocatedObjects(const HashMap<const void*, size_t>& map)
+float InspectorClientImpl::maximumPageScaleFactor()
{
- if (WebDevToolsAgentImpl* agent = devToolsAgent())
- agent->dumpUncountedAllocatedObjects(map);
+ return m_inspectedWebView->maximumPageScaleFactor();
+}
+
+void InspectorClientImpl::setPageScaleFactor(float pageScaleFactor)
+{
+ m_inspectedWebView->setPageScaleFactor(pageScaleFactor);
+}
+
+void InspectorClientImpl::showContextMenu(float x, float y, PassRefPtr<ContextMenuProvider> menuProvider)
+{
+ m_inspectedWebView->showContextMenuAtPoint(x, y, menuProvider);
}
void InspectorClientImpl::dispatchKeyEvent(const PlatformKeyboardEvent& event)
agent->dispatchMouseEvent(event);
}
-void InspectorClientImpl::setTraceEventCallback(TraceEventCallback callback)
+void InspectorClientImpl::setTraceEventCallback(const String& categoryFilter, TraceEventCallback callback)
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
- agent->setTraceEventCallback(callback);
+ agent->setTraceEventCallback(categoryFilter, callback);
+}
+
+void InspectorClientImpl::enableTracing(const String& categoryFilter)
+{
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ agent->enableTracing(categoryFilter);
+}
+
+void InspectorClientImpl::disableTracing()
+{
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ agent->disableTracing();
+}
+
+void InspectorClientImpl::resetTraceEventCallback()
+{
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ agent->resetTraceEventCallback();
}
void InspectorClientImpl::startGPUEventsRecording()
agent->stopGPUEventsRecording();
}
+void InspectorClientImpl::resumeStartup()
+{
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ agent->resumeStartup();
+}
+
WebDevToolsAgentImpl* InspectorClientImpl::devToolsAgent()
{
return static_cast<WebDevToolsAgentImpl*>(m_inspectedWebView->devToolsAgent());