#include "config.h"
#include "WebPage.h"
#include "WebKitWebPageAccessibilityObject.h"
#include "WebPageProxy.h"
#include "WebPageProxyMessages.h"
#include <WebCore/NotImplemented.h>
#include <WebCore/PlatformScreen.h>
#include <WebCore/PointerCharacteristics.h>
namespace WebKit {
using namespace WebCore;
void WebPage::platformInitialize()
{
#if ENABLE(ACCESSIBILITY)
m_accessibilityObject = adoptGRef(webkitWebPageAccessibilityObjectNew(this));
GUniquePtr<gchar> plugID(atk_plug_get_id(ATK_PLUG(m_accessibilityObject.get())));
send(Messages::WebPageProxy::BindAccessibilityTree(String::fromUTF8(plugID.get())));
#endif
}
void WebPage::platformReinitialize()
{
}
void WebPage::platformDetach()
{
}
bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&)
{
notImplemented();
return false;
}
bool WebPage::platformCanHandleRequest(const ResourceRequest&)
{
notImplemented();
return false;
}
String WebPage::platformUserAgent(const URL&) const
{
notImplemented();
return String();
}
bool WebPage::hoverSupportedByPrimaryPointingDevice() const
{
#if ENABLE(TOUCH_EVENTS)
return !screenIsTouchPrimaryInputDevice();
#else
return true;
#endif
}
bool WebPage::hoverSupportedByAnyAvailablePointingDevice() const
{
#if ENABLE(TOUCH_EVENTS)
return !screenHasTouchDevice();
#else
return true;
#endif
}
Optional<PointerCharacteristics> WebPage::pointerCharacteristicsOfPrimaryPointingDevice() const
{
#if ENABLE(TOUCH_EVENTS)
if (screenIsTouchPrimaryInputDevice())
return PointerCharacteristics::Coarse;
#endif
return PointerCharacteristics::Fine;
}
OptionSet<PointerCharacteristics> WebPage::pointerCharacteristicsOfAllAvailablePointingDevices() const
{
#if ENABLE(TOUCH_EVENTS)
if (screenHasTouchDevice())
return PointerCharacteristics::Coarse;
#endif
return PointerCharacteristics::Fine;
}
}