Add to ewk api for setting/getting the User Agent by using system info library.
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / API / efl / ewk_view.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 6917335..cc62359
@@ -413,13 +413,13 @@ static Eina_Bool _ewk_view_smart_gesture_start(Ewk_View_Smart_Data* smartData, c
             impl->focusRing->requestToShow(IntPoint(event->position.x, event->position.y));
         } else if (event->type == EWK_GESTURE_PAN) {
             if (impl->exceedTouchMoveThreshold)
-                impl->focusRing->hide();
+                impl->focusRing->requestToHide();
         } else {
             if (event->type != EWK_GESTURE_LONG_PRESS) {
 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
                 if (!impl->pageClient->isContextMenuVisible())
 #endif
-                    impl->focusRing->hide();
+                    impl->focusRing->requestToHide();
             }
         }
     }
@@ -447,8 +447,11 @@ static Eina_Bool _ewk_view_smart_gesture_start(Ewk_View_Smart_Data* smartData, c
             break;
 #if ENABLE(TIZEN_DRAG_SUPPORT)
         // 1. Check to start dragging.
-        if (hitTestResultData.isDragSupport) {
+        if (hitTestResultData.isDragSupport && !hitTestResultData.isContentEditable) {
             impl->pageClient->setDragPoint(scenePoint);
+            if (impl->pageClient->isDragMode()) {
+                impl->pageClient->setDragMode(false);
+            }
 #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
             if (impl->focusRing)
                 impl->focusRing->show(IntRect(), true);
@@ -458,8 +461,8 @@ static Eina_Bool _ewk_view_smart_gesture_start(Ewk_View_Smart_Data* smartData, c
         }
 #endif
         // 2. Check to show context menu.
-        if (!hitTestResultData.absoluteImageURL.isEmpty()
-            || !hitTestResultData.absoluteLinkURL.isEmpty()) {
+        if ((!hitTestResultData.absoluteImageURL.isEmpty() || !hitTestResultData.absoluteLinkURL.isEmpty())
+            && !hitTestResultData.isContentEditable) {
 #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
             if (impl->focusRing)
                 impl->focusRing->show(IntRect(), true);
@@ -514,16 +517,18 @@ static Eina_Bool _ewk_view_smart_gesture_end(Ewk_View_Smart_Data* smartData, con
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
 
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) && ENABLE(TIZEN_WEBKIT2_FOR_MOVING_TEXT_SELECTION_HANDLE_FROM_OSP)
-    if (impl->pageClient->isTextSelectionMode() && impl->pageClient->isTextSelectionHandleDowned())
+    if (impl->pageClient->isTextSelectionMode() && impl->pageClient->isTextSelectionHandleDowned()) {
+        impl->pageClient->initTextSelectionHandlesMouseDownedStatus();
         return true;
+    }
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
     if (impl->focusRing) {
 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
-        if (!impl->pageClient->isContextMenuVisible())
+        if (!impl->pageClient->isContextMenuVisible() || impl->pageClient->isTextSelectionMode())
 #endif
-            impl->focusRing->hide();
+            impl->focusRing->requestToHide();
     }
 #endif
 
@@ -545,14 +550,15 @@ static Eina_Bool _ewk_view_smart_gesture_end(Ewk_View_Smart_Data* smartData, con
 #endif
 
             impl->gestureClient->endTap(IntPoint(event->position.x, event->position.y));
-        } else if (event->count == 2)
+        } else if (event->count == 2) {
+#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
+            if (impl->focusRing)
+                impl->focusRing->requestToHide(true);
+#endif
             impl->gestureClient->endDoubleTap(IntPoint(event->position.x, event->position.y));
+        }
         break;
     case EWK_GESTURE_LONG_PRESS:
-#if ENABLE(TIZEN_DRAG_SUPPORT)
-        if (impl->pageClient->isDragMode())
-            impl->pageClient->setDragMode(false);
-#endif
         // Prcess endTap for LONG_PRESS gesture if text-selection and context menu did not work
         impl->gestureClient->endTap(IntPoint(event->position.x, event->position.y));
         break;
@@ -587,8 +593,12 @@ static Eina_Bool _ewk_view_smart_gesture_move(Ewk_View_Smart_Data* smartData, co
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
-    if (impl->focusRing && !(event->type == EWK_GESTURE_PAN && !impl->exceedTouchMoveThreshold))
-        impl->focusRing->hide();
+    if (impl->focusRing && !(event->type == EWK_GESTURE_PAN && !impl->exceedTouchMoveThreshold)) {
+#if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
+        if (!impl->pageClient->isContextMenuVisible())
+#endif
+            impl->focusRing->requestToHide(true);
+    }
 #endif
 
     switch (event->type) {
@@ -704,7 +714,7 @@ Eina_Bool _ewk_view_text_selection_down(Ewk_View_Smart_Data* smartData, int x, i
 {
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
 
-    return impl->pageClient->textSelectionDown(IntPoint(x, y), true);
+    return impl->pageClient->textSelectionDown(IntPoint(x, y));
 }
 
 Eina_Bool _ewk_view_text_selection_move(Ewk_View_Smart_Data* smartData, int x, int y)
@@ -712,7 +722,7 @@ Eina_Bool _ewk_view_text_selection_move(Ewk_View_Smart_Data* smartData, int x, i
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
 
     IntPoint point(x, y);
-    impl->pageClient->textSelectionMove(point, true);
+    impl->pageClient->textSelectionMove(point);
 
     return true;
 }
@@ -775,7 +785,7 @@ Eina_Bool _ewk_view_screen_reader_action_execute(Ewk_View_Smart_Data* smartData,
 {
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
 
-    return ScreenReaderProxy::screenReader().executeAction(impl, static_cast<Elm_Access_Action_Info*>(actionInfo));
+    return ScreenReaderProxy::executeAction(impl, 0, static_cast<Elm_Access_Action_Info*>(actionInfo));
 }
 #endif
 #endif // #if OS(TIZEN)
@@ -862,7 +872,12 @@ static void _ewk_view_smart_del(Evas_Object* ewkView)
     EwkViewImpl::removeFromPageViewMap(ewkView);
     EWK_VIEW_SD_GET(ewkView, smartData);
 #if ENABLE(TIZEN_SCREEN_READER)
-    ScreenReaderProxy::screenReader().disable(smartData->priv);
+    ScreenReaderProxy::screenReader().finalize(smartData->priv);
+#endif
+#if ENABLE(TIZEN_INPUT_COLOR_PICKER)
+    // Close color picker if it's opened.
+    if (smartData && smartData->priv && smartData->priv->inputPicker->isColorPickerShown())
+        ewk_view_color_picker_color_set(ewkView, 0, 0, 0, 0);
 #endif
     if (smartData && smartData->priv)
         _ewk_view_impl_del(smartData->priv);
@@ -884,6 +899,17 @@ static void _ewk_view_smart_resize(Evas_Object* ewkView, Evas_Coord width, Evas_
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
     evas_object_image_native_surface_set(smartData->image, 0);
 
+#if ENABLE(TIZEN_WEBKIT2_VIEW_VISIBILITY)
+    if (impl->pageClient->isVisible()) {
+        Ecore_Evas* ee = ecore_evas_ecore_evas_get(smartData->base.evas);
+        impl->pageClient->updateViewportSize(IntSize(width, height), ecore_evas_rotation_get(ee));
+    } else
+        impl->pageClient->setDeferUpdateViewportSize(true);
+#else
+    Ecore_Evas* ee = ecore_evas_ecore_evas_get(smartData->base.evas);
+    impl->pageClient->updateViewportSize(IntSize(width, height), ecore_evas_rotation_get(ee));
+#endif
+
 #if ENABLE(TIZEN_RUNTIME_BACKEND_SELECTION)
     if (!ewk_view_is_opengl_backend(ewkView))
         _ewk_view_composite(smartData);
@@ -953,7 +979,13 @@ static void _ewk_view_smart_calculate(Evas_Object* ewkView)
 #endif
 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE) && !ENABLE(TIZEN_WEBKIT2_EFL_WTR)
                 Ecore_Evas* ee = ecore_evas_ecore_evas_get(smartData->base.evas);
-                impl->pageClient->updateViewportSize(IntSize(width, height), ecore_evas_rotation_get(ee));
+                int newAngle = ecore_evas_rotation_get(ee);
+#if ENABLE(TIZEN_WEBKIT2_VIEW_VISIBILITY)
+                if (impl->pageClient->deferUpdateViewportSize()) {
+                    impl->pageClient->updateViewportSize(IntSize(width, height), newAngle);
+                }
+#endif
+                impl->pageClient->updateVisibleContentRectSize(IntSize(width, height));
                 if (ewk_view_is_opengl_backend(ewkView))
                     impl->pageClient->displayViewport();
 #endif
@@ -974,9 +1006,6 @@ static void _ewk_view_smart_calculate(Evas_Object* ewkView)
 #if ENABLE(TIZEN_WEBKIT2_TILED_SCROLLBAR)
         impl->pageClient->frameRectChanged();
 #endif
-#if ENABLE(TIZEN_SCREEN_READER)
-        impl->pageProxy->recalcScreenReaderFocusRect();
-#endif
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
         impl->pageClient->updateTextSelectionHandlesAndContextMenu(true);
 #endif
@@ -996,6 +1025,10 @@ static void _ewk_view_smart_show(Evas_Object* ewkView)
     if (evas_object_clipees_get(smartData->base.clipper))
         evas_object_show(smartData->base.clipper);
     evas_object_show(smartData->image);
+
+#if ENABLE(TIZEN_SCREEN_READER)
+    ScreenReaderProxy::screenReader().initialize(impl);
+#endif
 }
 
 static void _ewk_view_smart_hide(Evas_Object* ewkView)
@@ -1172,11 +1205,6 @@ static void _ewk_view_initialize(Evas_Object* ewkView, PassRefPtr<Ewk_Context> c
     impl->pageProxy->pageGroup()->preferences()->setForceCompositingMode(true);
     impl->pageProxy->pageGroup()->preferences()->setFrameFlatteningEnabled(true);
     impl->pageProxy->pageGroup()->preferences()->setAllowUniversalAccessFromFileURLs(true);
-
-    int deviceWidth, deviceHeight;
-    ecore_evas_screen_geometry_get(ecore_evas_ecore_evas_get(evas_object_evas_get(ewkView)), 0, 0, &deviceWidth, &deviceHeight);
-    impl->pageProxy->pageGroup()->preferences()->setDeviceWidth(deviceWidth);
-    impl->pageProxy->pageGroup()->preferences()->setDeviceHeight(deviceHeight);
 #endif
 
     impl->pageProxy->initializeWebPage();
@@ -1399,6 +1427,7 @@ Eina_Bool ewk_view_reload(Evas_Object* ewkView)
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
 
+    impl->pageClient->prepareRestoredVisibleContectRect();
     impl->pageProxy->reload(/*reloadFromOrigin*/ false);
     impl->informURLChange();
 
@@ -1631,7 +1660,7 @@ void ewk_view_text_change_in_textfield(Evas_Object* ewkView, const String& name,
 
     smartData->api->formdata_candidate_update_data(smartData, candidateList);
 
-    IntRect inputFieldRect = impl->pageClient->focusedNodeRect();
+    IntRect inputFieldRect = impl->transformToScene().mapRect(impl->pageClient->focusedNodeRect());
     smartData->api->formdata_candidate_show(smartData, inputFieldRect.x(), inputFieldRect.y(), inputFieldRect.width(), inputFieldRect.height());
 }
 
@@ -1659,15 +1688,18 @@ void ewk_view_form_password_data_fill(Evas_Object* ewkView)
     if (!passwordFormData.size())
         return;
 
-    String passwordFormAutofill = "try { function passwordFormAutofill() { var inputFields;";
+    String passwordFormAutofill = String::fromUTF8("try { function passwordFormAutofill() { var inputFields;");
     for (size_t i = 0; i < passwordFormData.size(); i++) {
-        passwordFormAutofill += String::format(" inputFields = document.getElementsByName(\"%s\");"
-            " for (var i = 0; i < inputFields.length; i++)"
-            " if (inputFields[i].tagName.toLowerCase() == \"input\" && (inputFields[i].type.toLowerCase() == \"text\" || inputFields[i].type.toLowerCase() == \"password\" || inputFields[i].type.toLowerCase() == \"email\"))"
-            " inputFields[i].value = \"%s\";",
-            passwordFormData[i].first.utf8().data(), passwordFormData[i].second.utf8().data());
+        passwordFormAutofill += String::fromUTF8(" inputFields = document.getElementsByName(\"");
+        passwordFormAutofill += passwordFormData[i].first;
+        passwordFormAutofill += String::fromUTF8("\");");
+        passwordFormAutofill += String::fromUTF8(" for (var i = 0; i < inputFields.length; i++)");
+        passwordFormAutofill += String::fromUTF8(" if (inputFields[i].tagName.toLowerCase() == \"input\" && (inputFields[i].type.toLowerCase() == \"text\" || inputFields[i].type.toLowerCase() == \"password\" || inputFields[i].type.toLowerCase() == \"email\"))");
+        passwordFormAutofill += String::fromUTF8(" inputFields[i].value = \"");
+        passwordFormAutofill += passwordFormData[i].second;
+        passwordFormAutofill += String::fromUTF8("\";");
     }
-    passwordFormAutofill += "} passwordFormAutofill(); } catch(e) { }";
+    passwordFormAutofill += String::fromUTF8("} passwordFormAutofill(); } catch(e) { }");
     ewk_view_script_execute(ewkView, passwordFormAutofill.utf8().data(), 0, 0);
 }
 
@@ -1968,9 +2000,17 @@ void ewkViewLoadCommitted(Evas_Object* ewkView)
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
     impl->gestureClient->reset();
 #endif
+#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
+    if (impl->focusRing)
+        impl->focusRing->hide();
+#endif
 #if ENABLE(TIZEN_ISF_PORT)
     impl->inputMethodContext()->hideIMFContext();
 #endif
+#if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
+    if (smartData->api->formdata_candidate_is_showing(smartData))
+        smartData->api->formdata_candidate_hide(smartData);
+#endif
     impl->informURLChange();
     evas_object_smart_callback_call(ewkView, "load,committed", 0);
 }
@@ -2000,6 +2040,8 @@ void ewkViewDidReceiveAuthenticationChallenge(Evas_Object* ewkView, Ewk_Auth_Cha
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
 
+    if (impl->authChallenge)
+        ewkAuthChallengeDelete(impl->authChallenge);
     impl->authChallenge = authChallenge;
 
     evas_object_smart_callback_call(ewkView, "authentication,challenge", impl->authChallenge);
@@ -2461,17 +2503,6 @@ bool ewk_view_focused_node_adjust(Evas_Object* ewkView, Eina_Bool adjustForExter
 #endif
 
 #if ENABLE(TIZEN_ISF_PORT)
-    Ecore_X_Window rootWin = ecore_x_window_root_first_get();
-    ecore_x_event_mask_set(rootWin, ECORE_X_EVENT_MASK_WINDOW_PROPERTY);
-    Ecore_X_Atom xAtom = ecore_x_atom_get("X External Keyboard Exist");
-    unsigned int connectedKeyboardNum = 0;
-    bool isExternalKeyboardConnected = false;
-
-    // get connected keyboard number
-    if (ecore_x_window_prop_card32_get(rootWin, xAtom, &connectedKeyboardNum, 1)
-        && connectedKeyboardNum)
-        isExternalKeyboardConnected = true;
-
     // We should treat both of ECORE_IMF_INPUT_PANEL_STATE_SHOW and ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW
     // as IME is shown. ECORE_IMF_INPUT_PANEL_STATE_HIDE is ignored at here.
     // input field zoom should not work with below conditions
@@ -2480,7 +2511,7 @@ bool ewk_view_focused_node_adjust(Evas_Object* ewkView, Eina_Bool adjustForExter
     // 3. imfContext is null(if adjustForExternalKeyboard is false)
     // 4. input panel state is hidden(if adjustForExternalKeyboard is false)
     if ((!(static_cast<PageClient*>(impl->pageClient.get()))->isViewFocused()
-        || (adjustForExternalKeyboard && !isExternalKeyboardConnected)
+        || (adjustForExternalKeyboard && !InputMethodContextEfl::shouldUseExternalKeyboard())
         || (!adjustForExternalKeyboard && !impl->inputMethodContext())
         || (!adjustForExternalKeyboard && !impl->inputMethodContext()->isShow()))
 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
@@ -2506,8 +2537,8 @@ bool ewk_view_focused_node_adjust(Evas_Object* ewkView, Eina_Bool adjustForExter
 
     IntRect visibleRect = impl->pageClient->visibleContentRect();
     IntPoint scrollPosition = visibleRect.location();
-    // Do not adjust scroll position if selection rect (caret) is visible after scaling.
-    if (!visibleRect.contains(selectionRect)) {
+    // Do not adjust scroll position if content is userscalable or selection rect (caret) is visible after scaling
+    if (impl->pageClient->userScalable() || !visibleRect.contains(selectionRect)) {
         // set paddings
         scrollPosition = IntPoint(selectionRect.x() - visibleRect.width() / 3, selectionRect.y() - visibleRect.height() / 3);
         // If both input field's position x and selection rect can be displayed together,
@@ -2516,6 +2547,10 @@ bool ewk_view_focused_node_adjust(Evas_Object* ewkView, Eina_Bool adjustForExter
             scrollPosition.setX(focusedNodeRect.x());
     }
 
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI("scroll position: [%d, %d], scale factor: [%.2f]", scrollPosition.x(), scrollPosition.y(), newScaleFactor);
+#endif
+
 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
     impl->pageClient->setVisibleContentRect(IntRect(scrollPosition, impl->size()), newScaleFactor);
 #else
@@ -2556,7 +2591,8 @@ static Eina_Bool _ewk_view_composite(void* data)
     evas_object_image_data_set(smartData->image, pixels);
     evas_object_image_data_update_add(smartData->image, 0, 0, ow, oh);
 
-    ewkViewFrameRendered(smartData->self);
+    if (impl->pageClient->notifiedNonemptyLayout())
+        ewkViewFrameRendered(smartData->self);
 
     impl->compositionAnimator = 0;
 
@@ -2651,6 +2687,7 @@ void ewk_view_suspend(Evas_Object* ewkView)
     // Multiple suspend of ActiveDOMObject makes unintended suspend/resume status of
     // the ActiveDOMObject.
     if (!impl->suspendedResources && (!impl->isWaitingForJavaScriptPopupReply || !impl->isWaitingForApplicationCachePermission || !impl->isWaitingForExceededQuotaPopupReply)) {
+        impl->pageProxy->suspendAnimations();
         impl->pageProxy->suspendJavaScriptAndResource();
         impl->suspendedResources = true;
     }
@@ -2683,6 +2720,7 @@ void ewk_view_resume(Evas_Object* ewkView)
     // Multiple suspend of ActiveDOMObject makes unintended suspend/resume status of
     // the ActiveDOMObject.
     if (impl->suspendedResources && (!impl->isWaitingForJavaScriptPopupReply || !impl->isWaitingForApplicationCachePermission || !impl->isWaitingForExceededQuotaPopupReply)) {
+        impl->pageProxy->resumeAnimations();
         impl->pageProxy->resumeJavaScriptAndResource();
         impl->suspendedResources = false;
     }
@@ -2832,6 +2870,14 @@ const char* ewk_view_user_agent_get(const Evas_Object* ewkView)
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, 0);
 
+#if OS(TIZEN)
+    WKRetainPtr<WKStringRef> userAgentString(AdoptWK, WKPageCopyUserAgent(toAPI(impl->pageProxy.get())));
+
+    int length = WKStringGetMaximumUTF8CStringSize(userAgentString.get());
+    OwnArrayPtr<char> buffer = adoptArrayPtr(new char[length]);
+    WKStringGetUTF8CString(userAgentString.get(), buffer.get(), length);
+    impl->userAgent = buffer.get();
+#else
     if (!impl->userAgent) {
         WKRetainPtr<WKStringRef> userAgentString(AdoptWK, WKPageCopyUserAgent(toAPI(impl->pageProxy.get())));
 
@@ -2840,9 +2886,41 @@ const char* ewk_view_user_agent_get(const Evas_Object* ewkView)
         WKStringGetUTF8CString(userAgentString.get(), buffer.get(), length);
         impl->userAgent = buffer.get();
     }
+#endif
 
     return impl->userAgent;
 }
+
+#if OS(TIZEN)
+Eina_Bool ewk_view_application_name_for_user_agent_set(Evas_Object* ewkView, const char* applicationName)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(applicationName, false);
+
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
+    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, false);
+
+    WKRetainPtr<WKStringRef> applicationNameString(AdoptWK, WKStringCreateWithUTF8CString(applicationName));
+    WKPageSetApplicationNameForUserAgent(toAPI(impl->pageProxy.get()), applicationNameString.get());
+
+    return true;
+}
+
+const char* ewk_view_application_name_for_user_agent_get(const Evas_Object* ewkView)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
+    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl, 0);
+
+    WKRetainPtr<WKStringRef> applicationNameString(AdoptWK, WKPageCopyApplicationNameForUserAgent(toAPI(impl->pageProxy.get())));
+
+    int length = WKStringGetMaximumUTF8CStringSize(applicationNameString.get());
+    OwnArrayPtr<char> buffer = adoptArrayPtr(new char[length]);
+    WKStringGetUTF8CString(applicationNameString.get(), buffer.get(), length);
+    impl->applicationName = buffer.get();
+
+    return impl->applicationName;
+}
+#endif
+
 Eina_Bool ewk_view_custom_header_add(const Evas_Object* ewkView, const char* name, const char* value)
 {
 #if ENABLE(TIZEN_CUSTOM_HEADERS)
@@ -2901,12 +2979,14 @@ Eina_Bool ewk_view_visibility_set(Evas_Object* ewkView, Eina_Bool enable)
         impl->pageClient->setDragMode(false);
 #endif
 
-#if ENABLE(TIZEN_SCREEN_READER)
-    if (enable)
-        ScreenReaderProxy::screenReader().enable(impl);
+    impl->pageClient->setIsVisible(enable);
+    return true;
+}
 #endif
 
-    impl->pageClient->setIsVisible(enable);
+#if ENABLE(TIZEN_BACKGROUND_DISK_CACHE)
+Eina_Bool ewk_view_foreground_set(Evas_Object* ewkView, Eina_Bool enable)
+{
     return true;
 }
 #endif
@@ -2956,26 +3036,26 @@ Evas_Object* ewk_view_screenshot_contents_get(const Evas_Object* ewkView, Eina_R
 
 unsigned int ewk_view_inspector_server_start(Evas_Object* ewkView, unsigned int port)
 {
-#if ENABLE(TIZEN_WEBKIT2_REMOTE_WEB_INSPECTOR)
+#if ENABLE(TIZEN_REMOTE_WEB_INSPECTOR)
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0);
     EWK_VIEW_IMPL_GET_OR_RETURN(sd, impl, 0);
 
     return impl->pageProxy->startInspectorServer(port);
 #else
-    LOG_ERROR("TIZEN_WEBKIT2_REMOTE_WEB_INSPECTOR is disabled.\n");
+    LOG_ERROR("TIZEN_REMOTE_WEB_INSPECTOR is disabled.\n");
     return 0;
 #endif
 }
 
 Eina_Bool ewk_view_inspector_server_stop(Evas_Object* ewkView)
 {
-#if ENABLE(TIZEN_WEBKIT2_REMOTE_WEB_INSPECTOR)
+#if ENABLE(TIZEN_REMOTE_WEB_INSPECTOR)
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, false);
     EWK_VIEW_IMPL_GET_OR_RETURN(sd, impl, false);
 
     return impl->pageProxy->stopInspectorServer();
 #else
-    LOG_ERROR("TIZEN_WEBKIT2_REMOTE_WEB_INSPECTOR is disabled.\n");
+    LOG_ERROR("TIZEN_REMOTE_WEB_INSPECTOR is disabled.\n");
     return false;
 #endif
 }
@@ -3036,6 +3116,16 @@ Eina_Bool ewk_view_scroll_size_get(const Evas_Object* ewkView, int* width, int*
     return true;
 }
 
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+void ewkViewNotifyPopupReplyWaitingState(Evas_Object* ewkView, bool isWaiting)
+{
+    if (isWaiting)
+        evas_object_smart_callback_call(ewkView, "popup,reply,wait,start", 0);
+    else
+        evas_object_smart_callback_call(ewkView, "popup,reply,wait,finish", 0);
+}
+#endif
+
 bool ewkViewRunJavaScriptAlert(Evas_Object* ewkView, WKStringRef alertText)
 {
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
@@ -3265,7 +3355,7 @@ void ewk_view_open_panel_reply(Evas_Object* ewkView, Eina_List* fileUrls, Eina_B
     unsigned int i = 0;
     KURL base(KURL(), "file://");
     EINA_LIST_FOREACH(fileUrls, list, data) {
-        KURL url(base, static_cast<char*>(data));
+        KURL url(base, String::fromUTF8(static_cast<char*>(data)));
         items[i++] = WKURLCreateWithUTF8CString(url.string().utf8().data());
     }
     WKRetainPtr<WKArrayRef> filesArray(AdoptWK, WKArrayCreate(items, size));
@@ -3913,6 +4003,14 @@ Eina_Bool ewk_view_auto_clear_text_selection_mode_get(Evas_Object* ewkView)
 {
     return ewk_settings_clear_text_selection_automatically_get(ewk_view_settings_get(ewkView));
 }
+
+void ewk_view_text_selection_range_clear(Evas_Object* ewkView)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+    impl->pageProxy->selectionRangeClear();
+}
 #endif // #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
 
 #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
@@ -4117,7 +4215,7 @@ void ewk_view_touch_event_handler_result_set(Evas_Object* ewkView, WebKit::WebEv
             impl->gestureClient->setTapEnabled(!wasHandled);
         }
 #if ENABLE(TIZEN_ISF_PORT)
-        else {
+        else if (impl->pageProxy->isViewVisible()) {
             IntPoint pointForHitTest = impl->transformFromScene().mapPoint(IntPoint(impl->touchDownPoint.x, impl->touchDownPoint.y));
             WebHitTestResult::Data hitTestResultData = impl->pageProxy->hitTestResultAtPoint(pointForHitTest);
             if (hitTestResultData.isContentEditable && impl->inputMethodContext()) {
@@ -4131,14 +4229,13 @@ void ewk_view_touch_event_handler_result_set(Evas_Object* ewkView, WebKit::WebEv
 }
 
 #if ENABLE(TIZEN_WEBKIT2_GET_TEXT_STYLE_FOR_SELECTION)
-void  ewkViewDidGetTextStyleStateForSelection(Evas_Object* ewkView, int underlineState, int italicState, int boldState, const IntPoint& startPoint, const IntPoint& endPoint)
+void  ewkViewTextStyleState(Evas_Object* ewkView, const IntPoint& startPoint, const IntPoint& endPoint)
 {
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
 
     EditorState editorState = impl->page()->editorState();
-
-    Ewk_Text_Style* textStyle = ewkTextStyleCreate(underlineState, italicState, boldState, startPoint, endPoint, editorState.bgColor, editorState.color);
+    Ewk_Text_Style* textStyle = ewkTextStyleCreate(editorState, startPoint, endPoint);
     evas_object_smart_callback_call(ewkView, "text,style,state", static_cast<void*>(textStyle));
     ewkTextStyleDelete(textStyle);
 }
@@ -4286,7 +4383,11 @@ Eina_Bool ewk_view_feed_touch_event(Evas_Object* ewkView, Ewk_Touch_Event_Type t
 #if ENABLE(TIZEN_GESTURE)
 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
     // We don't want to process touch event when context menu is shown.
-    if (impl->pageClient->isContextMenuVisible() && type != EWK_TOUCH_CANCEL)
+    if ((impl->pageClient->isContextMenuVisible() && type != EWK_TOUCH_CANCEL)
+#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+        && !impl->pageClient->isTextSelectionMode()
+#endif
+        )
         return true;
 #endif
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
@@ -4767,3 +4868,20 @@ void ewk_view_use_settings_font(Evas_Object* ewkView)
     impl->pageProxy->useSettingsFont();
 #endif
 }
+
+void ewk_view_fullscreen_exit(Evas_Object* ewkView)
+{
+#if ENABLE(TIZEN_FULLSCREEN_API)
+    TIZEN_LOGI("");
+
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+    EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+    if (!impl->pageProxy->fullScreenManager()->isFullScreen())
+        return;
+
+    impl->pageProxy->fullScreenManager()->requestExitFullScreen();
+#else
+    UNUSED_PARAM(ewkView);
+#endif
+}