[WK2] Change how to check the state of keypad
authorSeokju Kwon <seokju.kwon@samsung.com>
Tue, 7 Aug 2012 10:24:53 +0000 (19:24 +0900)
committerSeokju Kwon <seokju.kwon@samsung.com>
Thu, 23 Aug 2012 09:18:42 +0000 (18:18 +0900)
[Title] Change how to check the state of keypad
[Issue#] N/A
[Problem] Keypad doesn't show up in Email
[Cause] Focus out without calling blur()
[Solution] Check focusedNode when focusing in webview

Change-Id: Ied82e69403f9f5027fa2925539d43d53d4638adb

Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/efl/PageClientImpl.h
Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp

index b977c68..9d19d67 100755 (executable)
@@ -1152,6 +1152,16 @@ void PageClientImpl::handleInputMethodMousePress()
     m_preventNextCompositionCommit = true;
     ecore_imf_context_focus_out(m_inputMethod);
 }
+
+void PageClientImpl::handleInputMethodForFocusedNode()
+{
+    LOG(ISF, "%s\n", __func__);
+
+    if (!page()->focusedFrame())
+        return;
+
+    page()->handleInputMethodForFocusedNode();
+}
 #endif
 
 void PageClientImpl::updateFormNavigation(int length, int offset)
index cfacdfb..0efd64c 100755 (executable)
@@ -124,6 +124,7 @@ public:
     void handleInputMethodKeydown();
     void handleInputMethodMousePress();
     Ecore_IMF_Context* getIMFContext() { return m_inputMethod; }
+    void handleInputMethodForFocusedNode();
 #endif
 
     void setViewFocused(bool focused) { m_viewFocused = focused; }
index c49817c..4cf3b90 100755 (executable)
@@ -414,8 +414,7 @@ static Eina_Bool _ewk_view_smart_focus_in(Ewk_View_Smart_Data* smartData)
 #endif // #if OS(TIZEN)
     priv->pageClient->page()->viewStateDidChange(WebPageProxy::ViewIsFocused | WebPageProxy::ViewWindowIsActive);
 #if ENABLE(TIZEN_ISF_PORT)
-    if (priv->pageClient->isShowImeState())
-        priv->pageClient->handleInputMethodState();
+    priv->pageClient->handleInputMethodForFocusedNode();
 #endif
     return true;
 }
index 6a2dbff..46379c6 100755 (executable)
@@ -878,6 +878,7 @@ void recordingSurfaceSetEnableSet(bool enable);
     int getCursorOffsetPosition();
     String getContentOfPosition();
     bool deleteSurroundingPosition();
+    void handleInputMethodForFocusedNode();
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
index 8290acd..5a2d192 100755 (executable)
@@ -240,6 +240,14 @@ void WebPageProxy::getInputMethodState(bool& state)
 {
      state = static_cast<PageClientImpl*>(m_pageClient)->getInputMethodState();
 }
+
+void WebPageProxy::handleInputMethodForFocusedNode()
+{
+    if (!isValid())
+        return;
+
+    process()->send(Messages::WebPage::HandleInputMethodForFocusedNode(), m_pageID);
+}
 #endif
 
 void WebPageProxy::requestUpdateFormNavigation()
index bfefa02..4d21e3d 100755 (executable)
@@ -211,6 +211,7 @@ public:
     void getCursorOffsetPosition(int& offset);
     void getContentOfPosition(String& content);
     void deleteSurroundingPosition(bool& result);
+    void handleInputMethodForFocusedNode();
 #endif
     void scrollMainFrameBy(const WebCore::IntSize&);
     void scrollMainFrameTo(const WebCore::IntPoint&);
index 5cd4ebb..3b83db1 100755 (executable)
@@ -333,6 +333,7 @@ messages -> WebPage {
     GetCursorOffsetPosition() -> (int offset)
     GetContentOfPosition() -> (String offset)
     DeleteSurroundingPosition() -> (bool result);
+    HandleInputMethodForFocusedNode();
 #endif
 #endif
 #if PLATFORM(QT)
index a2eed01..1079e1f 100755 (executable)
 #include "RenderLayer.h"
 #include "WebGraphicsLayer.h"
 #endif
+
+#if ENABLE(TIZEN_ISF_PORT)
+#include "WebEditorClient.h"
+#endif
+
 #endif // #if OS(TIZEN)
 
 using namespace WebCore;
@@ -538,6 +543,15 @@ void WebPage::deleteSurroundingPosition(bool& result)
 
     frame->editor()->deleteWithDirection(DirectionBackward, CharacterGranularity, false, true);
 }
+
+void WebPage::handleInputMethodForFocusedNode()
+{
+    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    if (frame
+        && frame->document()
+        && frame->document()->focusedNode())
+        corePage()->editorClient()->setInputMethodState(frame->document()->focusedNode()->shouldUseInputMethod());
+}
 #endif
 
 #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)