This source file includes following definitions.
- highlight
- hideHighlight
- sendMessageToFrontend
- flush
- updateInspectorStateCookie
- clearBrowserCache
- clearBrowserCookies
- overrideDeviceMetrics
- overridesShowPaintRects
- setShowPaintRects
- setShowDebugBorders
- setShowFPSCounter
- setContinuousPaintingEnabled
- setShowScrollBottleneckRects
- requestPageScaleFactor
- getAllocatedObjects
- dumpUncountedAllocatedObjects
- dispatchKeyEvent
- dispatchMouseEvent
- setTraceEventCallback
- resetTraceEventCallback
- startGPUEventsRecording
- stopGPUEventsRecording
- devToolsAgent
#include "config.h"
#include "InspectorClientImpl.h"
#include "WebDevToolsAgentImpl.h"
#include "WebViewClient.h"
#include "WebViewImpl.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;
namespace blink {
InspectorClientImpl::InspectorClientImpl(WebViewImpl* webView)
: m_inspectedWebView(webView)
{
ASSERT(m_inspectedWebView);
}
InspectorClientImpl::~InspectorClientImpl()
{
}
void InspectorClientImpl::highlight()
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
agent->highlight();
}
void InspectorClientImpl::hideHighlight()
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
agent->hideHighlight();
}
void InspectorClientImpl::sendMessageToFrontend(PassRefPtr<WebCore::JSONObject> message)
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
agent->sendMessageToFrontend(message);
}
void InspectorClientImpl::flush()
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
agent->flush();
}
void InspectorClientImpl::updateInspectorStateCookie(const WTF::String& inspectorState)
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
agent->updateInspectorStateCookie(inspectorState);
}
void InspectorClientImpl::clearBrowserCache()
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
agent->clearBrowserCache();
}
void InspectorClientImpl::clearBrowserCookies()
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
agent->clearBrowserCookies();
}
void InspectorClientImpl::overrideDeviceMetrics(int width, int height, float deviceScaleFactor, bool emulateViewport, bool fitWindow)
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
agent->overrideDeviceMetrics(width, height, deviceScaleFactor, emulateViewport, fitWindow);
}
bool InspectorClientImpl::overridesShowPaintRects()
{
return m_inspectedWebView->isAcceleratedCompositingActive();
}
void InspectorClientImpl::setShowPaintRects(bool show)
{
m_inspectedWebView->setShowPaintRects(show);
}
void InspectorClientImpl::setShowDebugBorders(bool show)
{
m_inspectedWebView->setShowDebugBorders(show);
}
void InspectorClientImpl::setShowFPSCounter(bool show)
{
m_inspectedWebView->setShowFPSCounter(show);
}
void InspectorClientImpl::setContinuousPaintingEnabled(bool enabled)
{
m_inspectedWebView->setContinuousPaintingEnabled(enabled);
}
void InspectorClientImpl::setShowScrollBottleneckRects(bool show)
{
m_inspectedWebView->setShowScrollBottleneckRects(show);
}
void InspectorClientImpl::requestPageScaleFactor(float scale, const IntPoint& origin)
{
m_inspectedWebView->setPageScaleFactor(scale, origin);
}
void InspectorClientImpl::getAllocatedObjects(HashSet<const void*>& set)
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
agent->getAllocatedObjects(set);
}
void InspectorClientImpl::dumpUncountedAllocatedObjects(const HashMap<const void*, size_t>& map)
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
agent->dumpUncountedAllocatedObjects(map);
}
void InspectorClientImpl::dispatchKeyEvent(const PlatformKeyboardEvent& event)
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
agent->dispatchKeyEvent(event);
}
void InspectorClientImpl::dispatchMouseEvent(const PlatformMouseEvent& event)
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
agent->dispatchMouseEvent(event);
}
void InspectorClientImpl::setTraceEventCallback(const String& categoryFilter, TraceEventCallback callback)
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
agent->setTraceEventCallback(categoryFilter, callback);
}
void InspectorClientImpl::resetTraceEventCallback()
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
agent->resetTraceEventCallback();
}
void InspectorClientImpl::startGPUEventsRecording()
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
agent->startGPUEventsRecording();
}
void InspectorClientImpl::stopGPUEventsRecording()
{
if (WebDevToolsAgentImpl* agent = devToolsAgent())
agent->stopGPUEventsRecording();
}
WebDevToolsAgentImpl* InspectorClientImpl::devToolsAgent()
{
return static_cast<WebDevToolsAgentImpl*>(m_inspectedWebView->devToolsAgent());
}
}