Fixed when user tap on linkable contents, somtimes focus ring is not shown.
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / efl / WebPageProxyEfl.cpp
index e492cc1..720a9a8 100755 (executable)
@@ -79,7 +79,7 @@ Evas_Object* WebPageProxy::viewWidget()
 String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent)
 {
 #if OS(TIZEN)
-    return String::fromUTF8("Mozilla/5.0 (Linux; Tizen 2.1; sdk) AppleWebKit/537.3 (KHTML, like Gecko) Version/2.1 Mobile Safari/537.3");
+    return String::fromUTF8("Mozilla/5.0 (Linux; Tizen 2.2; sdk) AppleWebKit/537.3 (KHTML, like Gecko) Version/2.2 Mobile Safari/537.3");
 #endif
 
     WTF::String platform;
@@ -238,6 +238,14 @@ void WebPageProxy::textChangeInTextField(const String& name, const String& value
 #endif
 
 #if ENABLE(TIZEN_ISF_PORT)
+void WebPageProxy::prepareKeyDownEvent()
+{
+    if (!isValid())
+        return;
+
+    process()->send(Messages::WebPage::PrepareKeyDownEvent(), m_pageID);
+}
+
 int WebPageProxy::getCursorOffset()
 {
     if (!isValid())
@@ -402,14 +410,23 @@ void WebPageProxy::initializeTizenClient(const WKPageTizenClient* client)
 }
 
 #if ENABLE(TIZEN_WEBKIT2_HIT_TEST)
+#if ENABLE(TOUCH_ADJUSTMENT)
+WebHitTestResult::Data WebPageProxy::hitTestResultAtPoint(const IntPoint& point, int hitTestMode, const IntSize& area)
+#else
 WebHitTestResult::Data WebPageProxy::hitTestResultAtPoint(const IntPoint& point, int hitTestMode)
+#endif
 {
     WebHitTestResult::Data hitTestResultData;
     if (!isValid())
         return hitTestResultData;
 
+#if ENABLE(TOUCH_ADJUSTMENT)
+    process()->sendSync(Messages::WebPage::HitTestResultAtPoint(point, hitTestMode, area),
+                        Messages::WebPage::HitTestResultAtPoint::Reply(hitTestResultData), m_pageID);
+#else
     process()->sendSync(Messages::WebPage::HitTestResultAtPoint(point, hitTestMode),
                         Messages::WebPage::HitTestResultAtPoint::Reply(hitTestResultData), m_pageID);
+#endif
 
     return hitTestResultData;
 }
@@ -867,33 +884,33 @@ void WebPageProxy::startOfflinePageSave(String subresourceFolderName)
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
-bool WebPageProxy::selectClosestWord(const IntPoint& point, bool isStartedTextSelectionFromOutside)
+bool WebPageProxy::selectClosestWord(const IntPoint& point)
 {
     if (!isValid())
         return false;
 
     bool result = false;
-    process()->sendSync(Messages::WebPage::SelectClosestWord(point, isStartedTextSelectionFromOutside), Messages::WebPage::SelectClosestWord::Reply(result), m_pageID);
+    process()->sendSync(Messages::WebPage::SelectClosestWord(point), Messages::WebPage::SelectClosestWord::Reply(result), m_pageID);
     return result;
 }
 
-bool WebPageProxy::setLeftSelection(const IntPoint& point)
+int WebPageProxy::setLeftSelection(const IntPoint& point, const int direction)
 {
     if (!isValid())
-        return false;
+        return 0;
 
-    bool result = false;
-    process()->sendSync(Messages::WebPage::SetLeftSelection(point), Messages::WebPage::SetLeftSelection::Reply(result), m_pageID);
+    int result = 0;
+    process()->sendSync(Messages::WebPage::SetLeftSelection(point, direction), Messages::WebPage::SetLeftSelection::Reply(result), m_pageID);
     return result;
 }
 
-bool WebPageProxy::setRightSelection(const IntPoint& point)
+int WebPageProxy::setRightSelection(const IntPoint& point, const int direction)
 {
     if (!isValid())
-        return false;
+        return 0;
 
-    bool result;
-    process()->sendSync(Messages::WebPage::SetRightSelection(point), Messages::WebPage::SetRightSelection::Reply(result), m_pageID);
+    int result = 0;
+    process()->sendSync(Messages::WebPage::SetRightSelection(point, direction), Messages::WebPage::SetRightSelection::Reply(result), m_pageID);
     return result;
 }
 
@@ -968,7 +985,7 @@ void WebPageProxy::didGetLinkMagnifierRect(const IntPoint& position, const IntRe
 void WebPageProxy::openLink(const IntPoint& position)
 {
 #if ENABLE(GESTURE_EVENTS)
-    IntPoint globalPosition(EwkViewImpl::fromEvasObject(viewWidget())->transformToScreen().mapPoint(position));
+    IntPoint globalPosition(static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->transformToScreen().mapPoint(position));
     WebGestureEvent gesture(WebEvent::GestureSingleTap, position, globalPosition, WebEvent::Modifiers(0), ecore_time_get());
     handleGestureEvent(gesture);
 #endif
@@ -976,16 +993,6 @@ void WebPageProxy::openLink(const IntPoint& position)
 #endif
 
 #if ENABLE(TIZEN_SCREEN_READER)
-void WebPageProxy::raiseTapEvent(const IntPoint& position)
-{
-#if ENABLE(GESTURE_EVENTS)
-    IntPoint globalPosition = EwkViewImpl::fromEvasObject(viewWidget())->transformToScreen().mapPoint(position);
-    process()->send(Messages::WebPage::RaiseTapEvent(position, globalPosition), m_pageID);
-#else
-    UNUSED_PARAM(position);
-#endif
-}
-
 bool WebPageProxy::moveScreenReaderFocus(bool forward)
 {
     bool result;
@@ -998,9 +1005,28 @@ void WebPageProxy::moveScreenReaderFocusByPoint(const IntPoint& point)
     process()->send(Messages::WebPage::MoveScreenReaderFocusByPoint(point), m_pageID);
 }
 
+void WebPageProxy::clearScreenReaderFocus()
+{
+    process()->send(Messages::WebPage::ClearScreenReaderFocus(), m_pageID);
+}
+
+bool WebPageProxy::raiseTapEvent(const IntPoint& position)
+{
+    IntPoint globalPosition = static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->transformToScreen().mapPoint(position);
+    bool result;
+    process()->sendSync(Messages::WebPage::RaiseTapEvent(position, globalPosition), Messages::WebPage::RaiseTapEvent::Reply(result), m_pageID);
+
+    return result;
+}
+
+void WebPageProxy::adjustScreenReaderFocusedObjectValue(bool up)
+{
+    process()->send(Messages::WebPage::AdjustScreenReaderFocusedObjectValue(up), m_pageID);
+}
+
 void WebPageProxy::recalcScreenReaderFocusRect()
 {
-    if (!ScreenReaderProxy::screenReader().isEnabled())
+    if (!ScreenReaderProxy::screenReader().isActive(static_cast<PageClientImpl*>(m_pageClient)->viewImpl()))
         return;
 
     process()->send(Messages::WebPage::RecalcScreenReaderFocusRect(), m_pageID);