InspectorClientBlackBerry.cpp [plain text]
#include "config.h"
#include "InspectorClientBlackBerry.h"
#include "BackingStore.h"
#include "Frame.h"
#include "GraphicsContext.h"
#include "InspectorController.h"
#include "NotImplemented.h"
#include "Page.h"
#include "RenderObject.h"
#include "WebPageClient.h"
#include "WebPage_p.h"
namespace WebCore {
InspectorClientBlackBerry::InspectorClientBlackBerry(BlackBerry::WebKit::WebPagePrivate* webPagePrivate)
: m_webPagePrivate(webPagePrivate)
{
m_inspectorSettingsMap = adoptPtr(new SettingsMap);
}
void InspectorClientBlackBerry::inspectorDestroyed()
{
delete this;
}
void InspectorClientBlackBerry::highlight()
{
m_webPagePrivate->setInspectorOverlayClient(this);
}
void InspectorClientBlackBerry::hideHighlight()
{
m_webPagePrivate->setInspectorOverlayClient(0);
}
InspectorFrontendChannel* InspectorClientBlackBerry::openInspectorFrontend(InspectorController*)
{
notImplemented();
return 0;
}
void InspectorClientBlackBerry::closeInspectorFrontend()
{
notImplemented();
}
void InspectorClientBlackBerry::bringFrontendToFront()
{
notImplemented();
}
bool InspectorClientBlackBerry::sendMessageToFrontend(const String& message)
{
CString utf8Message = message.utf8();
m_webPagePrivate->m_client->handleWebInspectorMessageToFrontend(0, utf8Message.data(), utf8Message.length());
return true;
}
void InspectorClientBlackBerry::clearBrowserCache()
{
m_webPagePrivate->m_client->clearCache();
}
void InspectorClientBlackBerry::clearBrowserCookies()
{
m_webPagePrivate->m_client->clearCookies();
}
bool InspectorClientBlackBerry::canOverrideDeviceMetrics()
{
return true;
}
void InspectorClientBlackBerry::overrideDeviceMetrics(int width, int height, float fontScaleFactor, bool)
{
m_webPagePrivate->applySizeOverride(width, height);
m_webPagePrivate->setTextZoomFactor(fontScaleFactor);
}
bool InspectorClientBlackBerry::supportsFrameInstrumentation()
{
return true;
}
void InspectorClientBlackBerry::updateInspectorStateCookie(const String&)
{
notImplemented();
};
void InspectorClientBlackBerry::paintInspectorOverlay(GraphicsContext& gc)
{
InspectorController* inspectorController = m_webPagePrivate->m_page->inspectorController();
if (inspectorController)
inspectorController->drawHighlight(gc);
}
}