From: Seokju Kwon Date: Tue, 7 Aug 2012 10:24:53 +0000 (+0900) Subject: [WK2] Change how to check the state of keypad X-Git-Tag: accepted/2.0/20130307.072448~99^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f54ab4f7920b39662924f138d0ac1b445196c4d;p=profile%2Fivi%2Fwebkit-efl.git [WK2] Change how to check the state of keypad [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 --- diff --git a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp index b977c68..9d19d67 100755 --- a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp +++ b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp @@ -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) diff --git a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.h b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.h index cfacdfb..0efd64c 100755 --- a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.h +++ b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.h @@ -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; } diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp index c49817c..4cf3b90 100755 --- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp @@ -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; } diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h index 6a2dbff..46379c6 100755 --- a/Source/WebKit2/UIProcess/WebPageProxy.h +++ b/Source/WebKit2/UIProcess/WebPageProxy.h @@ -878,6 +878,7 @@ void recordingSurfaceSetEnableSet(bool enable); int getCursorOffsetPosition(); String getContentOfPosition(); bool deleteSurroundingPosition(); + void handleInputMethodForFocusedNode(); #endif #if ENABLE(TIZEN_WEBKIT2_TILED_AC) diff --git a/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp b/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp index 8290acd..5a2d192 100755 --- a/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp +++ b/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp @@ -240,6 +240,14 @@ void WebPageProxy::getInputMethodState(bool& state) { state = static_cast(m_pageClient)->getInputMethodState(); } + +void WebPageProxy::handleInputMethodForFocusedNode() +{ + if (!isValid()) + return; + + process()->send(Messages::WebPage::HandleInputMethodForFocusedNode(), m_pageID); +} #endif void WebPageProxy::requestUpdateFormNavigation() diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h index bfefa02..4d21e3d 100755 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h @@ -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&); diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in index 5cd4ebb..3b83db1 100755 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in @@ -333,6 +333,7 @@ messages -> WebPage { GetCursorOffsetPosition() -> (int offset) GetContentOfPosition() -> (String offset) DeleteSurroundingPosition() -> (bool result); + HandleInputMethodForFocusedNode(); #endif #endif #if PLATFORM(QT) diff --git a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp index a2eed01..1079e1f 100755 --- a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp +++ b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp @@ -104,6 +104,11 @@ #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)