Set return key type if input type is search
authorSangYong Park <sy302.park@samsung.com>
Thu, 23 May 2013 10:13:01 +0000 (19:13 +0900)
committerSangYong Park <sy302.park@samsung.com>
Wed, 5 Jun 2013 02:54:30 +0000 (11:54 +0900)
[Title] Set return key type if input type is search
[Issue#] P130426-7919
[Problem] Return key type is invalid if input type is search
[Cause] Return key type was not set
[Solution] Return key type should be set

Change-Id: I2ba2afaa4fa943be8b438f39b1d59cc16e034787

Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp
Source/WebKit2/UIProcess/efl/InputMethodContextEfl.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 8716672..c6902c9 100755 (executable)
@@ -369,7 +369,7 @@ void InputMethodContextEfl::updateTextInputState()
 #endif
 
 #if ENABLE(TIZEN_ISF_PORT)
-void InputMethodContextEfl::initializeIMFContext(Ecore_IMF_Context* context, Ecore_IMF_Input_Panel_Layout layout, int layoutVariation)
+void InputMethodContextEfl::initializeIMFContext(Ecore_IMF_Context* context, Ecore_IMF_Input_Panel_Layout layout, int layoutVariation, Ecore_IMF_Input_Panel_Return_Key_Type returnKeyType)
 {
     ecore_imf_context_input_panel_enabled_set(context, false);
     ecore_imf_context_input_panel_event_callback_add(context, ECORE_IMF_INPUT_PANEL_STATE_EVENT, onIMFInputPanelStateChanged, this);
@@ -384,6 +384,7 @@ void InputMethodContextEfl::initializeIMFContext(Ecore_IMF_Context* context, Eco
     ecore_imf_context_input_panel_layout_set(context, layout);
     if (layoutVariation >= 0)
         ecore_imf_context_input_panel_layout_variation_set(context, layoutVariation);
+    ecore_imf_context_input_panel_return_key_type_set(context, returnKeyType);
 }
 
 void InputMethodContextEfl::setUseInputMethod(bool use)
@@ -412,6 +413,7 @@ void InputMethodContextEfl::setIMFContext(const EditorState& editor)
     const String& type = editor.inputMethodHints;
     Ecore_IMF_Input_Panel_Layout layout;
     int layoutVariation = -1;
+    Ecore_IMF_Input_Panel_Return_Key_Type returnKeyType = ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
 
     if (type == "number") {
         layout = ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY;
@@ -433,8 +435,11 @@ void InputMethodContextEfl::setIMFContext(const EditorState& editor)
         layout = ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER;
     else if (type == "password")
         layout = ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD;
-    else
+    else {
         layout = ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL;
+        if (type == "search")
+            returnKeyType = ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH;
+    }
 
     OwnPtr<Ecore_IMF_Context> context;
     if (m_contextID == editor.inputMethodContextID)
@@ -444,7 +449,7 @@ void InputMethodContextEfl::setIMFContext(const EditorState& editor)
 
     if (!context) {
         context = createIMFContext(evas_object_evas_get(m_viewImpl->view()));
-        initializeIMFContext(context.get(), layout, layoutVariation);
+        initializeIMFContext(context.get(), layout, layoutVariation, returnKeyType);
     }
 
     revertIMFContext();
index a439889..c9e9692 100755 (executable)
@@ -72,7 +72,7 @@ private:
     static void onIMFPreeditSequenceChanged(void* data, Ecore_IMF_Context*, void* eventInfo);
 
 #if ENABLE(TIZEN_ISF_PORT)
-    void initializeIMFContext(Ecore_IMF_Context*, Ecore_IMF_Input_Panel_Layout, int);
+    void initializeIMFContext(Ecore_IMF_Context*, Ecore_IMF_Input_Panel_Layout, int, Ecore_IMF_Input_Panel_Return_Key_Type);
 
     static void onIMFInputPanelStateChanged(void*, Ecore_IMF_Context*, int);
     static void onIMFInputPanelGeometryChanged(void*, Ecore_IMF_Context*, int);
index 19fbc0b..3e25309 100755 (executable)
@@ -595,7 +595,9 @@ EditorState WebPage::editorState() const
                     result.inputMethodHints = "decimalNumber";
                 else
                     result.inputMethodHints = "number";
-            } else
+            } else if (type == "text" && formControl->form() && equalIgnoringCase(formControl->form()->fastGetAttribute(HTMLNames::roleAttr), "search"))
+                result.inputMethodHints = "search";
+            else
                 result.inputMethodHints = type;
 
             result.surroundingText = formControl->value();