[M108 Migration][IME] Support IME additional functionalities 19/286819/7
authorGajendra N <gajendra.n@samsung.com>
Fri, 13 Jan 2023 06:25:34 +0000 (11:55 +0530)
committerBot Blink <blinkbot@samsung.com>
Tue, 17 Jan 2023 03:47:56 +0000 (03:47 +0000)
Functionalities:
1) Notify FocusedNodeChanged and TextInputStateChanged status
2) New parameters during FocusedNodeChanged:
   password_minlength, radio_or_checkbox, input_maxlength, editable etc.
3) |is_in_form_tag| check
4) inputDevice and remote control info
5) Few other IME related changes, etc.

References:
https://review.tizen.org/gerrit/279650
https://review.tizen.org/gerrit/284673

Change-Id: I3cf646b83727a2aa6d3f23216afa22e972eb80e6
Signed-off-by: Gajendra N <gajendra.n@samsung.com>
36 files changed:
content/browser/renderer_host/render_frame_host_delegate.h
content/browser/renderer_host/render_frame_host_impl.cc
content/browser/renderer_host/render_frame_host_impl.h
content/browser/renderer_host/render_widget_host_view_aura.cc
content/browser/renderer_host/render_widget_host_view_aura.h
content/browser/renderer_host/render_widget_host_view_base.h
content/browser/web_contents/web_contents_impl.cc
content/browser/web_contents/web_contents_impl.h
third_party/blink/common/input/web_coalesced_input_event_mojom_traits.cc
third_party/blink/public/common/input/web_keyboard_event.h
third_party/blink/public/mojom/BUILD.gn
third_party/blink/public/mojom/frame/frame.mojom
third_party/blink/public/mojom/input/input_handler.mojom
third_party/blink/public/platform/web_text_input_info.h
third_party/blink/public/web/web_input_element.h
third_party/blink/renderer/core/dom/document.cc
third_party/blink/renderer/core/editing/ime/input_method_controller.cc
third_party/blink/renderer/core/editing/ime/input_method_controller.h
third_party/blink/renderer/core/events/keyboard_event.cc
third_party/blink/renderer/core/events/keyboard_event.h
third_party/blink/renderer/core/events/keyboard_event.idl
third_party/blink/renderer/core/exported/web_input_element.cc
third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
third_party/blink/renderer/platform/widget/input/widget_base_input_handler.cc
third_party/blink/renderer/platform/widget/widget_base.cc
third_party/blink/renderer/platform/widget/widget_base.h
tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc
tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h
tizen_src/chromium_impl/ui/ozone/platform/efl/efl_input_method_context.cc
tizen_src/chromium_impl/ui/ozone/platform/efl/efl_keycode_map.h
tizen_src/chromium_impl/ui/ozone/platform/efl/im_context_efl.cc
ui/base/ime/mojom/BUILD.gn
ui/base/ime/mojom/text_input_state.mojom
ui/events/blink/web_input_event_traits.cc
ui/events/event.cc
ui/events/keycodes/keyboard_codes_posix.h

index 3cd9dd8..b27e11e 100644 (file)
@@ -381,7 +381,13 @@ class CONTENT_EXPORT RenderFrameHostDelegate {
   virtual void OnFocusedElementChangedInFrame(
       RenderFrameHostImpl* frame,
       const gfx::Rect& bounds_in_root_view,
   virtual void OnFocusedElementChangedInFrame(
       RenderFrameHostImpl* frame,
       const gfx::Rect& bounds_in_root_view,
-      blink::mojom::FocusType focus_type) {}
+      blink::mojom::FocusType focus_type
+#if BUILDFLAG(IS_EFL)
+      ,
+      blink::mojom::FocusedNodeChangedParamsPtr params
+#endif
+  ) {
+  }
 
   // The page is trying to open a new page (e.g. a popup window). The window
   // should be created associated the process of |opener|, but it should not
 
   // The page is trying to open a new page (e.g. a popup window). The window
   // should be created associated the process of |opener|, but it should not
index e4e16cc..c735f4a 100644 (file)
@@ -6821,7 +6821,8 @@ void RenderFrameHostImpl::DidDispatchDOMContentLoadedEvent() {
 void RenderFrameHostImpl::FocusedElementChanged(
     bool is_editable_element,
     const gfx::Rect& bounds_in_frame_widget,
 void RenderFrameHostImpl::FocusedElementChanged(
     bool is_editable_element,
     const gfx::Rect& bounds_in_frame_widget,
-    blink::mojom::FocusType focus_type) {
+    blink::mojom::FocusType focus_type,
+    blink::mojom::FocusedNodeChangedParamsPtr params) {
   if (!GetView())
     return;
 
   if (!GetView())
     return;
 
@@ -6832,7 +6833,12 @@ void RenderFrameHostImpl::FocusedElementChanged(
       gfx::Rect(GetView()->TransformPointToRootCoordSpace(
                     bounds_in_frame_widget.origin()),
                 bounds_in_frame_widget.size()),
       gfx::Rect(GetView()->TransformPointToRootCoordSpace(
                     bounds_in_frame_widget.origin()),
                 bounds_in_frame_widget.size()),
-      focus_type);
+      focus_type
+#if BUILDFLAG(IS_EFL)
+      ,
+      std::move(params)
+#endif
+  );
 }
 
 void RenderFrameHostImpl::TextSelectionChanged(const std::u16string& text,
 }
 
 void RenderFrameHostImpl::TextSelectionChanged(const std::u16string& text,
index 246afde..db82798 100644 (file)
@@ -2204,9 +2204,11 @@ class CONTENT_EXPORT RenderFrameHostImpl
   void UpdateFaviconURL(
       std::vector<blink::mojom::FaviconURLPtr> favicon_urls) override;
   void DownloadURL(blink::mojom::DownloadURLParamsPtr params) override;
   void UpdateFaviconURL(
       std::vector<blink::mojom::FaviconURLPtr> favicon_urls) override;
   void DownloadURL(blink::mojom::DownloadURLParamsPtr params) override;
-  void FocusedElementChanged(bool is_editable_element,
-                             const gfx::Rect& bounds_in_frame_widget,
-                             blink::mojom::FocusType focus_type) override;
+  void FocusedElementChanged(
+      bool is_editable_element,
+      const gfx::Rect& bounds_in_frame_widget,
+      blink::mojom::FocusType focus_type,
+      blink::mojom::FocusedNodeChangedParamsPtr params) override;
   void TextSelectionChanged(const std::u16string& text,
                             uint32_t offset,
                             const gfx::Range& range) override;
   void TextSelectionChanged(const std::u16string& text,
                             uint32_t offset,
                             const gfx::Range& range) override;
index 297f4dc..fcee03c 100644 (file)
@@ -578,6 +578,14 @@ void RenderWidgetHostViewAura::SelectionChanged(const std::u16string& text,
   if (offscreen_helper_)
     offscreen_helper_->SelectionChanged(text, offset, range);
 }
   if (offscreen_helper_)
     offscreen_helper_->SelectionChanged(text, offset, range);
 }
+
+void RenderWidgetHostViewAura::TextInputStateChanged(
+    const ui::mojom::TextInputState& params) {
+  RenderWidgetHostViewBase::TextInputStateChanged(params);
+
+  if (offscreen_helper_)
+    offscreen_helper_->TextInputStateChanged(params);
+}
 #endif
 
 void RenderWidgetHostViewAura::EnsureSurfaceSynchronizedForWebTest() {
 #endif
 
 void RenderWidgetHostViewAura::EnsureSurfaceSynchronizedForWebTest() {
@@ -650,6 +658,11 @@ void RenderWidgetHostViewAura::HideImpl() {
   DCHECK(visibility_ == Visibility::HIDDEN ||
          visibility_ == Visibility::OCCLUDED);
 
   DCHECK(visibility_ == Visibility::HIDDEN ||
          visibility_ == Visibility::OCCLUDED);
 
+#if BUILDFLAG(IS_EFL)
+  if (offscreen_helper_)
+    offscreen_helper_->Hide();
+#endif
+
   if (!host()->is_hidden()) {
     host()->WasHidden();
     aura::WindowTreeHost* host = window_->GetHost();
   if (!host()->is_hidden()) {
     host()->WasHidden();
     aura::WindowTreeHost* host = window_->GetHost();
@@ -2049,7 +2062,14 @@ viz::SurfaceId RenderWidgetHostViewAura::GetCurrentSurfaceId() const {
 
 void RenderWidgetHostViewAura::FocusedNodeChanged(
     bool editable,
 
 void RenderWidgetHostViewAura::FocusedNodeChanged(
     bool editable,
-    const gfx::Rect& node_bounds_in_screen) {
+    const gfx::Rect& node_bounds_in_screen
+#if BUILDFLAG(IS_TIZEN_TV)
+    ,
+    bool is_radio_or_checkbox,
+    int password_input_minlength,
+    int input_maxlength
+#endif
+) {
   // The last gesture most likely caused the focus change. The focus reason will
   // be incorrect if the focus was triggered without a user gesture.
   // TODO(https://crbug.com/824604): Get the focus reason from the renderer
   // The last gesture most likely caused the focus change. The focus reason will
   // be incorrect if the focus was triggered without a user gesture.
   // TODO(https://crbug.com/824604): Get the focus reason from the renderer
@@ -2061,6 +2081,14 @@ void RenderWidgetHostViewAura::FocusedNodeChanged(
     input_method->CancelComposition(this);
   has_composition_text_ = false;
 
     input_method->CancelComposition(this);
   has_composition_text_ = false;
 
+#if BUILDFLAG(IS_TIZEN_TV)
+  if (offscreen_helper_) {
+    offscreen_helper_->FocusedNodeChanged(editable, is_radio_or_checkbox,
+                                          password_input_minlength,
+                                          input_maxlength);
+  }
+#endif
+
 #if BUILDFLAG(IS_WIN)
   if (window_ && virtual_keyboard_controller_win_) {
     virtual_keyboard_controller_win_->FocusedNodeChanged(editable);
 #if BUILDFLAG(IS_WIN)
   if (window_ && virtual_keyboard_controller_win_) {
     virtual_keyboard_controller_win_->FocusedNodeChanged(editable);
index f106b68..fa5af30 100644 (file)
@@ -201,7 +201,15 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
   viz::FrameSinkId GetRootFrameSinkId() override;
   viz::SurfaceId GetCurrentSurfaceId() const override;
   void FocusedNodeChanged(bool is_editable_node,
   viz::FrameSinkId GetRootFrameSinkId() override;
   viz::SurfaceId GetCurrentSurfaceId() const override;
   void FocusedNodeChanged(bool is_editable_node,
-                          const gfx::Rect& node_bounds_in_screen) override;
+                          const gfx::Rect& node_bounds_in_screen
+#if BUILDFLAG(IS_TIZEN_TV)
+                          ,
+                          bool is_radio_or_checkbox,
+                          int password_input_minlength,
+                          int input_maxlength
+#endif
+                          ) override;
+
   void OnSynchronizedDisplayPropertiesChanged(bool rotation = false) override;
   viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties(
       const cc::RenderFrameMetadata& metadata) override;
   void OnSynchronizedDisplayPropertiesChanged(bool rotation = false) override;
   viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties(
       const cc::RenderFrameMetadata& metadata) override;
@@ -415,6 +423,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
   void SelectionChanged(const std::u16string& text,
                         size_t offset,
                         const gfx::Range& range) override;
   void SelectionChanged(const std::u16string& text,
                         size_t offset,
                         const gfx::Range& range) override;
+  void TextInputStateChanged(const ui::mojom::TextInputState& params) override;
 #endif
 
  protected:
 #endif
 
  protected:
index ec2b115..ee2ad3c 100644 (file)
@@ -248,7 +248,15 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView {
   virtual void SetMainFrameAXTreeID(ui::AXTreeID id) {}
   // Informs that the focused DOM node has changed.
   virtual void FocusedNodeChanged(bool is_editable_node,
   virtual void SetMainFrameAXTreeID(ui::AXTreeID id) {}
   // Informs that the focused DOM node has changed.
   virtual void FocusedNodeChanged(bool is_editable_node,
-                                  const gfx::Rect& node_bounds_in_screen) {}
+                                  const gfx::Rect& node_bounds_in_screen
+#if BUILDFLAG(IS_TIZEN_TV)
+                                  ,
+                                  bool is_radio_or_checkbox,
+                                  int password_input_minlength,
+                                  int input_maxlength
+#endif
+  ) {
+  }
 
   // Requests to start stylus writing and returns true if successful.
   virtual bool RequestStartStylusWriting();
 
   // Requests to start stylus writing and returns true if successful.
   virtual bool RequestStartStylusWriting();
index 5b8d390..0d4eb02 100644 (file)
@@ -7934,7 +7934,12 @@ void WebContentsImpl::OnAdvanceFocus(RenderFrameHostImpl* source_rfh) {
 void WebContentsImpl::OnFocusedElementChangedInFrame(
     RenderFrameHostImpl* frame,
     const gfx::Rect& bounds_in_root_view,
 void WebContentsImpl::OnFocusedElementChangedInFrame(
     RenderFrameHostImpl* frame,
     const gfx::Rect& bounds_in_root_view,
-    blink::mojom::FocusType focus_type) {
+    blink::mojom::FocusType focus_type
+#if BUILDFLAG(IS_EFL)
+    ,
+    blink::mojom::FocusedNodeChangedParamsPtr params
+#endif
+) {
   OPTIONAL_TRACE_EVENT1("content",
                         "WebContentsImpl::OnFocusedElementChangedInFrame",
                         "render_frame_host", frame);
   OPTIONAL_TRACE_EVENT1("content",
                         "WebContentsImpl::OnFocusedElementChangedInFrame",
                         "render_frame_host", frame);
@@ -7948,8 +7953,14 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
   origin += root_view->GetViewBounds().OffsetFromOrigin();
   gfx::Rect bounds_in_screen(origin, bounds_in_root_view.size());
 
   origin += root_view->GetViewBounds().OffsetFromOrigin();
   gfx::Rect bounds_in_screen(origin, bounds_in_root_view.size());
 
-  root_view->FocusedNodeChanged(frame->has_focused_editable_element(),
-                                bounds_in_screen);
+  root_view->FocusedNodeChanged(
+      frame->has_focused_editable_element(), bounds_in_screen
+#if BUILDFLAG(IS_TIZEN_TV)
+      ,
+      params->is_radio_or_checkbox_input_node, params->password_input_minlength,
+      params->input_maxlength
+#endif
+  );
 
   FocusedNodeDetails details = {frame->has_focused_editable_element(),
                                 bounds_in_screen, focus_type};
 
   FocusedNodeDetails details = {frame->has_focused_editable_element(),
                                 bounds_in_screen, focus_type};
index f8d6342..bd28298 100644 (file)
@@ -701,7 +701,13 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
   void OnFocusedElementChangedInFrame(
       RenderFrameHostImpl* frame,
       const gfx::Rect& bounds_in_root_view,
   void OnFocusedElementChangedInFrame(
       RenderFrameHostImpl* frame,
       const gfx::Rect& bounds_in_root_view,
-      blink::mojom::FocusType focus_type) override;
+      blink::mojom::FocusType focus_type
+#if BUILDFLAG(IS_EFL)
+      ,
+      blink::mojom::FocusedNodeChangedParamsPtr params
+#endif
+      ) override;
+
   void OnAdvanceFocus(RenderFrameHostImpl* source_rfh) override;
   FrameTree* CreateNewWindow(
       RenderFrameHostImpl* opener,
   void OnAdvanceFocus(RenderFrameHostImpl* source_rfh) override;
   FrameTree* CreateNewWindow(
       RenderFrameHostImpl* opener,
index 053d68b..7fc97c7 100644 (file)
@@ -118,6 +118,13 @@ bool StructTraits<blink::mojom::EventDataView,
     key_event->is_browser_shortcut = key_data->is_browser_shortcut;
     CopyString(key_event->text, key_data->text);
     CopyString(key_event->unmodified_text, key_data->unmodified_text);
     key_event->is_browser_shortcut = key_data->is_browser_shortcut;
     CopyString(key_event->text, key_data->text);
     CopyString(key_event->unmodified_text, key_data->unmodified_text);
+
+#if BUILDFLAG(IS_TIZEN_TV)
+    key_event->is_from_rc = key_data->is_from_rc;
+    strncpy(key_event->device_name, key_data->device_name.c_str(),
+            sizeof(key_event->device_name) - 1);
+    key_event->device_name[sizeof(key_event->device_name) - 1] = '\0';
+#endif
   } else if (blink::WebInputEvent::IsGestureEventType(type)) {
     blink::mojom::GestureDataPtr gesture_data;
     if (!event.ReadGestureData<blink::mojom::GestureDataPtr>(&gesture_data))
   } else if (blink::WebInputEvent::IsGestureEventType(type)) {
     blink::mojom::GestureDataPtr gesture_data;
     if (!event.ReadGestureData<blink::mojom::GestureDataPtr>(&gesture_data))
@@ -385,7 +392,12 @@ StructTraits<blink::mojom::EventDataView,
       key_event->dom_key, key_event->dom_code, key_event->windows_key_code,
       key_event->native_key_code, key_event->is_system_key,
       key_event->is_browser_shortcut, key_event->text,
       key_event->dom_key, key_event->dom_code, key_event->windows_key_code,
       key_event->native_key_code, key_event->is_system_key,
       key_event->is_browser_shortcut, key_event->text,
-      key_event->unmodified_text);
+      key_event->unmodified_text
+#if BUILDFLAG(IS_TIZEN_TV)
+      ,
+      key_event->is_from_rc, key_event->device_name
+#endif
+  );
 }
 
 // static
 }
 
 // static
index eb0be1e..33e94ce 100644 (file)
@@ -19,6 +19,20 @@ class BLINK_COMMON_EXPORT WebKeyboardEvent : public WebInputEvent {
   // them PODs.
   static const size_t kTextLengthCap = 4;
 
   // them PODs.
   static const size_t kTextLengthCap = 4;
 
+#if BUILDFLAG(IS_TIZEN_TV)
+  // The devicename list:
+  // const std::string devicenameSmartView = "SMART_VIEW";
+  // const std::string devicenamePanelKey = "wt61p807 panel key device";
+  // const std::string devicenameRemote = "wt61p807 rc device";
+  // const std::string devicenameIME = "ime";
+  // const std::string devicenameSmartRC = "Smart Control";
+  // const std::string devicenameUSBKeyboard = "CHICONY HP Basic USB Keyboard";
+  // etc: device name set by evas_device_name_set
+
+  // Maxmimum Length of device name
+  static const size_t kDeviceNameLengthCap = 40;
+#endif
+
   // |windows_key_code| is the Windows key code associated with this key
   // event. Sometimes it's direct from the event (i.e. on Windows),
   // sometimes it's via a mapping function. If you want a list, see
   // |windows_key_code| is the Windows key code associated with this key
   // event. Sometimes it's direct from the event (i.e. on Windows),
   // sometimes it's via a mapping function. If you want a list, see
@@ -63,6 +77,14 @@ class BLINK_COMMON_EXPORT WebKeyboardEvent : public WebInputEvent {
   char16_t text[kTextLengthCap] = {};
   char16_t unmodified_text[kTextLengthCap] = {};
 
   char16_t text[kTextLengthCap] = {};
   char16_t unmodified_text[kTextLengthCap] = {};
 
+#if BUILDFLAG(IS_TIZEN_TV)
+  // Whether the key event from Remote Control
+  bool is_from_rc = false;
+
+  // This is a string identifying device name
+  char device_name[kDeviceNameLengthCap] = {};
+#endif
+
   WebKeyboardEvent(Type type, int modifiers, base::TimeTicks time_stamp)
       : WebInputEvent(type, modifiers, time_stamp) {}
 
   WebKeyboardEvent(Type type, int modifiers, base::TimeTicks time_stamp)
       : WebInputEvent(type, modifiers, time_stamp) {}
 
index 0adc86b..ea681fe 100644 (file)
@@ -10,6 +10,10 @@ if (is_android) {
   import("//build/config/android/config.gni")
 }
 
   import("//build/config/android/config.gni")
 }
 
+if (use_efl) {
+  import("//tizen_src/build/config/tizen_features.gni")
+}
+
 # This target includes all mojom interfaces which can be used from
 # renderer/platform. In particular these mojom interfaces can't use types that
 # are typemapped to a type in renderer/core.
 # This target includes all mojom interfaces which can be used from
 # renderer/platform. In particular these mojom interfaces can't use types that
 # are typemapped to a type in renderer/core.
@@ -325,6 +329,9 @@ mojom("mojom_platform") {
   if (is_android || is_mac) {
     enabled_features += [ "is_using_open_color_chooser" ]
   }
   if (is_android || is_mac) {
     enabled_features += [ "is_using_open_color_chooser" ]
   }
+  if (tizen_product_tv) {
+    enabled_features += [ "is_tizen_tv" ]
+  }
 
   shared_cpp_typemaps = [
     {
 
   shared_cpp_typemaps = [
     {
index f7b27a6..7a4564f 100644 (file)
@@ -182,6 +182,12 @@ interface KeepAliveHandleFactory {
       pending_receiver<blink.mojom.KeepAliveHandle> keep_alive_handle);
 };
 
       pending_receiver<blink.mojom.KeepAliveHandle> keep_alive_handle);
 };
 
+struct FocusedNodeChangedParams {
+  bool is_radio_or_checkbox_input_node;
+  int32 password_input_minlength;
+  int32 input_maxlength;
+};
+
 // Implemented in Browser, this interface defines frame-specific methods that
 // will be invoked from the render process (e.g. content::RenderFrameHostImpl).
 //
 // Implemented in Browser, this interface defines frame-specific methods that
 // will be invoked from the render process (e.g. content::RenderFrameHostImpl).
 //
@@ -412,7 +418,8 @@ interface LocalFrameHost {
   // local root's view, and it will be an empty bounds if there is no focused
   // element.
   FocusedElementChanged(bool is_editable_element,
   // local root's view, and it will be an empty bounds if there is no focused
   // element.
   FocusedElementChanged(bool is_editable_element,
-                        gfx.mojom.Rect bounds_in_frame_widget, blink.mojom.FocusType focus_type);
+                        gfx.mojom.Rect bounds_in_frame_widget, blink.mojom.FocusType focus_type,
+                        FocusedNodeChangedParams params);
 
   // Notification that the text selection has changed.
   // Note: The second parameter is the character based offset of the
 
   // Notification that the text selection has changed.
   // Note: The second parameter is the character based offset of the
index d5f3287..f51bf3d 100644 (file)
@@ -44,6 +44,13 @@ struct KeyData {
   bool is_browser_shortcut;
   mojo_base.mojom.String16 text;
   mojo_base.mojom.String16 unmodified_text;
   bool is_browser_shortcut;
   mojo_base.mojom.String16 text;
   mojo_base.mojom.String16 unmodified_text;
+
+  [EnableIf=is_tizen_tv]
+  bool is_from_rc;
+
+  // Only for TV, identify the device name property in keyboard event
+  [EnableIf=is_tizen_tv]
+  string device_name;
 };
 
 struct PointerData {
 };
 
 struct PointerData {
index b0402f9..d0c228f 100644 (file)
@@ -64,6 +64,11 @@ struct BLINK_PLATFORM_EXPORT WebTextInputInfo {
   // The end position of the current composition, or -1 if there is none.
   int composition_end = -1;
 
   // The end position of the current composition, or -1 if there is none.
   int composition_end = -1;
 
+#if BUILDFLAG(IS_EFL)
+  // The value whether focused input field is included in 'Form' tag.
+  bool is_in_form_tag = false;
+#endif
+
   // The inputmode attribute value of the currently focused input field.
   WebTextInputMode input_mode = kWebTextInputModeDefault;
 
   // The inputmode attribute value of the currently focused input field.
   WebTextInputMode input_mode = kWebTextInputModeDefault;
 
index 7fa7456..9215d75 100644 (file)
@@ -70,6 +70,9 @@ class BLINK_EXPORT WebInputElement final : public WebFormControlElement {
   // defaultMaxLength() when no valid has been set, whereas 'maxLength' IDL
   // attribute returns -1.
   int MaxLength() const;
   // defaultMaxLength() when no valid has been set, whereas 'maxLength' IDL
   // attribute returns -1.
   int MaxLength() const;
+#if BUILDFLAG(IS_TIZEN_TV)
+  int MinLength() const;
+#endif
   void SetActivatedSubmit(bool);
   int size() const;
   void SetChecked(bool,
   void SetActivatedSubmit(bool);
   int size() const;
   void SetChecked(bool,
index 0b4458b..45c0ae6 100644 (file)
 #include "third_party/blink/renderer/platform/wtf/text/string_buffer.h"
 #include "third_party/blink/renderer/platform/wtf/text/text_encoding_registry.h"
 
 #include "third_party/blink/renderer/platform/wtf/text/string_buffer.h"
 #include "third_party/blink/renderer/platform/wtf/text/text_encoding_registry.h"
 
+#if BUILDFLAG(IS_TIZEN_TV)
+#include "third_party/blink/public/web/web_input_element.h"
+#endif
+
 #ifndef NDEBUG
 using WeakDocumentSet = blink::HeapHashSet<blink::WeakMember<blink::Document>>;
 static WeakDocumentSet& LiveDocumentSet();
 #ifndef NDEBUG
 using WeakDocumentSet = blink::HeapHashSet<blink::WeakMember<blink::Document>>;
 static WeakDocumentSet& LiveDocumentSet();
@@ -439,6 +443,56 @@ bool DefaultFaviconAllowedByCSP(const Document* document, const IconURL& icon) {
       ContentSecurityPolicy::CheckHeaderType::kCheckAll);
 }
 
       ContentSecurityPolicy::CheckHeaderType::kCheckAll);
 }
 
+#if BUILDFLAG(IS_TIZEN_TV)
+static bool IsRadioOrCheckboxInputNode(Element* element) {
+  if (!element)
+    return false;
+
+  element->GetDocument().UpdateStyleAndLayoutTree();
+  blink::WebElement web_element = WebElement(element);
+
+  if (web_element.IsNull() || !web_element.HasHTMLTagName("input"))
+    return false;
+
+  const WebInputElement input = web_element.To<WebInputElement>();
+  if (input.IsRadioButton() || input.IsCheckbox())
+    return true;
+
+  return false;
+}
+
+static int PasswordInputElementMinLength(Element* element) {
+  if (!element)
+    return -1;
+
+  element->GetDocument().UpdateStyleAndLayoutTree();
+  blink::WebElement web_element = WebElement(element);
+
+  if (web_element.IsNull() || !web_element.HasHTMLTagName("input"))
+    return -1;
+
+  const WebInputElement input = web_element.To<WebInputElement>();
+  if (input.IsPasswordField())
+    return input.MinLength();
+
+  return -1;
+}
+
+static int InputElementMaxLength(Element* element) {
+  if (!element)
+    return -1;
+
+  element->GetDocument().UpdateStyleAndLayoutTree();
+  blink::WebElement web_element = WebElement(element);
+
+  if (web_element.IsNull() || !web_element.HasHTMLTagName("input"))
+    return -1;
+
+  const WebInputElement input = web_element.To<WebInputElement>();
+  return input.MaxLength();
+}
+#endif  // IS_TIZEN_TV
+
 }  // namespace
 
 static const unsigned kCMaxWriteRecursionDepth = 21;
 }  // namespace
 
 static const unsigned kCMaxWriteRecursionDepth = 21;
@@ -5167,8 +5221,18 @@ void Document::SendFocusNotification(Element* new_focused_element,
     }
   }
 
     }
   }
 
+  auto params = mojom::blink::FocusedNodeChangedParams::New();
+#if BUILDFLAG(IS_TIZEN_TV)
+  if (new_focused_element) {
+    params->is_radio_or_checkbox_input_node =
+        IsRadioOrCheckboxInputNode(new_focused_element);
+    params->password_input_minlength =
+        PasswordInputElementMinLength(new_focused_element);
+    params->input_maxlength = InputElementMaxLength(new_focused_element);
+  }
+#endif
   GetFrame()->GetLocalFrameHostRemote().FocusedElementChanged(
   GetFrame()->GetLocalFrameHostRemote().FocusedElementChanged(
-      is_editable, element_bounds_in_dips, focus_type);
+      is_editable, element_bounds_in_dips, focus_type, std::move(params));
 }
 
 void Document::NotifyFocusedElementChanged(Element* old_focused_element,
 }
 
 void Document::NotifyFocusedElementChanged(Element* old_focused_element,
index 125ad0d..015d5c6 100644 (file)
@@ -1582,6 +1582,9 @@ WebTextInputInfo InputMethodController::TextInputInfo() const {
   info.virtual_keyboard_policy = VirtualKeyboardPolicyOfFocusedElement();
   info.type = TextInputType();
   info.flags = TextInputFlags();
   info.virtual_keyboard_policy = VirtualKeyboardPolicyOfFocusedElement();
   info.type = TextInputType();
   info.flags = TextInputFlags();
+#if BUILDFLAG(IS_EFL)
+  info.is_in_form_tag = IsFocusedElementInFormTag();
+#endif
   if (info.type == kWebTextInputTypeNone)
     return info;
 
   if (info.type == kWebTextInputTypeNone)
     return info;
 
@@ -1896,4 +1899,15 @@ WebVector<ui::ImeTextSpan> InputMethodController::GetImeTextSpans() const {
   return ime_text_spans;
 }
 
   return ime_text_spans;
 }
 
+#if BUILDFLAG(IS_EFL)
+bool InputMethodController::IsFocusedElementInFormTag() const {
+  Node* node = GetDocument().FocusedElement();
+  if (!node || !IsTextControl(*node))
+    return false;
+
+  TextControlElement* text_control = ToTextControl(node);
+  return text_control && text_control->Form();
+}
+#endif
+
 }  // namespace blink
 }  // namespace blink
index a088acd..a570dca 100644 (file)
@@ -243,6 +243,10 @@ class CORE_EXPORT InputMethodController final
   //   3) SetComposingText() (SetComposition())
   void RemoveSuggestionMarkerInCompositionRange();
 
   //   3) SetComposingText() (SetComposition())
   void RemoveSuggestionMarkerInCompositionRange();
 
+#if BUILDFLAG(IS_EFL)
+  bool IsFocusedElementInFormTag() const;
+#endif
+
   void DispatchCompositionUpdateEvent(LocalFrame& frame, const String& text);
   void DispatchBeforeInputFromComposition(EventTarget* target,
                                           InputEvent::InputType input_type,
   void DispatchCompositionUpdateEvent(LocalFrame& frame, const String& text);
   void DispatchBeforeInputFromComposition(EventTarget* target,
                                           InputEvent::InputType input_type,
index cfc48b2..e63ca0e 100644 (file)
@@ -223,4 +223,12 @@ void KeyboardEvent::Trace(Visitor* visitor) const {
   UIEventWithKeyState::Trace(visitor);
 }
 
   UIEventWithKeyState::Trace(visitor);
 }
 
+const String KeyboardEvent::inputDevice() const {
+#if BUILDFLAG(IS_TIZEN_TV)
+  return KeyEvent() ? FromUTF8(KeyEvent()->device_name) : FromUTF8("");
+#else
+  return FromUTF8("undefined");
+#endif
+}
+
 }  // namespace blink
 }  // namespace blink
index 039c16c..21b27c8 100644 (file)
@@ -97,6 +97,7 @@ class CORE_EXPORT KeyboardEvent final : public UIEventWithKeyState {
   unsigned which() const override;
   bool isComposing() const { return is_composing_; }
 
   unsigned which() const override;
   bool isComposing() const { return is_composing_; }
 
+  const String inputDevice() const;
   void Trace(Visitor*) const override;
 
  private:
   void Trace(Visitor*) const override;
 
  private:
index 6ef9b98..aa2d4c3 100644 (file)
@@ -40,6 +40,9 @@
     readonly attribute boolean          isComposing;
     boolean getModifierState(DOMString keyArg);
 
     readonly attribute boolean          isComposing;
     boolean getModifierState(DOMString keyArg);
 
+    // Property to send device name when key event occurs
+    readonly attribute DOMString        inputDevice;
+
     // https://w3c.github.io/uievents/#idl-interface-KeyboardEvent-initializers
     [CallWith=ScriptState, Measure] void initKeyboardEvent(DOMString type,
                                                            optional boolean bubbles = false,
     // https://w3c.github.io/uievents/#idl-interface-KeyboardEvent-initializers
     [CallWith=ScriptState, Measure] void initKeyboardEvent(DOMString type,
                                                            optional boolean bubbles = false,
index 9099f3e..3eeddc5 100644 (file)
@@ -92,6 +92,12 @@ int WebInputElement::MaxLength() const {
   return max_len == -1 ? DefaultMaxLength() : max_len;
 }
 
   return max_len == -1 ? DefaultMaxLength() : max_len;
 }
 
+#if BUILDFLAG(IS_TIZEN_TV)
+int WebInputElement::MinLength() const {
+  return ConstUnwrap<HTMLInputElement>()->minLength();
+}
+#endif
+
 void WebInputElement::SetActivatedSubmit(bool activated) {
   Unwrap<HTMLInputElement>()->SetActivatedSubmit(activated);
 }
 void WebInputElement::SetActivatedSubmit(bool activated) {
   Unwrap<HTMLInputElement>()->SetActivatedSubmit(activated);
 }
index 5e5704a..18c4feb 100644 (file)
@@ -3521,6 +3521,14 @@ void WebFrameWidgetImpl::DidHandleGestureEvent(const WebGestureEvent& event) {
     else
       widget_base_->ShowVirtualKeyboard();
   }
     else
       widget_base_->ShowVirtualKeyboard();
   }
+#elif BUILDFLAG(IS_EFL)
+  if (!HasFocus())
+    return;
+
+  if ((event.GetType() == WebInputEvent::Type::kGestureTap) ||
+      (event.GetType() == WebInputEvent::Type::kGestureLongPress)) {
+    widget_base_->ShowVirtualKeyboard();
+  }
 #endif
 }
 
 #endif
 }
 
index 36665ff..e69dd4f 100644 (file)
@@ -413,6 +413,21 @@ void WidgetBaseInputHandler::HandleInputEvent(
   }
 #endif
 
   }
 #endif
 
+#if BUILDFLAG(IS_TIZEN_TV)
+  if (WebInputEvent::IsKeyboardEventType(input_event.GetType())) {
+    // Allow to show IME by TV RC device OK key
+    const WebKeyboardEvent& key_event =
+        static_cast<const WebKeyboardEvent&>(input_event);
+    if (key_event.windows_key_code == ui::VKEY_RETURN &&
+        key_event.is_from_rc == true &&
+        widget_->client()->GetTextInputType() !=
+            WebTextInputType::kWebTextInputTypeNone) {
+      widget_->ShowVirtualKeyboard();
+      prevent_default = true;
+    }
+  }
+#endif
+
   if (WebInputEvent::IsGestureEventType(input_event.GetType())) {
     const WebGestureEvent& gesture_event =
         static_cast<const WebGestureEvent&>(input_event);
   if (WebInputEvent::IsGestureEventType(input_event.GetType())) {
     const WebGestureEvent& gesture_event =
         static_cast<const WebGestureEvent&>(input_event);
index 2e57c4f..78bb164 100644 (file)
@@ -1013,6 +1013,9 @@ void WidgetBase::UpdateTextInputStateInternal(bool show_virtual_keyboard,
       text_input_info_ != new_info || !new_info.ime_text_spans.empty() ||
       can_compose_inline_ != new_can_compose_inline ||
       always_hide_ime_ != always_hide_ime || vk_policy_ != new_vk_policy ||
       text_input_info_ != new_info || !new_info.ime_text_spans.empty() ||
       can_compose_inline_ != new_can_compose_inline ||
       always_hide_ime_ != always_hide_ime || vk_policy_ != new_vk_policy ||
+#if BUILDFLAG(IS_EFL)
+      (text_input_is_in_form_tag_ != new_info.is_in_form_tag) ||
+#endif
       (new_vk_policy == ui::mojom::VirtualKeyboardPolicy::MANUAL &&
        (last_vk_visibility_request !=
         ui::mojom::VirtualKeyboardVisibilityRequest::NONE)) ||
       (new_vk_policy == ui::mojom::VirtualKeyboardPolicy::MANUAL &&
        (last_vk_visibility_request !=
         ui::mojom::VirtualKeyboardVisibilityRequest::NONE)) ||
@@ -1066,6 +1069,12 @@ void WidgetBase::UpdateTextInputStateInternal(bool show_virtual_keyboard,
     params->show_ime_if_needed = show_virtual_keyboard;
     params->always_hide_ime = always_hide_ime;
     params->reply_to_request = reply_to_request;
     params->show_ime_if_needed = show_virtual_keyboard;
     params->always_hide_ime = always_hide_ime;
     params->reply_to_request = reply_to_request;
+#if BUILDFLAG(IS_EFL)
+    params->is_in_form_tag = new_info.is_in_form_tag;
+    text_input_is_in_form_tag_ = new_info.is_in_form_tag;
+    params->is_user_action = is_user_action_;
+    is_user_action_ = true;
+#endif
     widget_host_->TextInputStateChanged(std::move(params));
 
     text_input_info_ = new_info;
     widget_host_->TextInputStateChanged(std::move(params));
 
     text_input_info_ = new_info;
@@ -1116,6 +1125,10 @@ void WidgetBase::ShowVirtualKeyboardOnElementFocus() {
   // mouse button or the finger and a text input element is focused at that
   // time. Focus event itself shouldn't trigger virtual keyboard.
   UpdateTextInputState();
   // mouse button or the finger and a text input element is focused at that
   // time. Focus event itself shouldn't trigger virtual keyboard.
   UpdateTextInputState();
+#elif BUILDFLAG(IS_EFL)
+  // If webview hasn't focus, IME shouldn't be shown.
+  if (has_focus_)
+    ShowVirtualKeyboard();
 #else
   ShowVirtualKeyboard();
 #endif
 #else
   ShowVirtualKeyboard();
 #endif
index b73ee82..a26cd3b 100644 (file)
@@ -542,6 +542,14 @@ class PLATFORM_EXPORT WidgetBase : public mojom::blink::Widget,
   // Indicates that we shouldn't bother generated paint events.
   bool is_hidden_;
 
   // Indicates that we shouldn't bother generated paint events.
   bool is_hidden_;
 
+#if BUILDFLAG(IS_EFL)
+  // Check the focus is by user gesture.
+  bool is_user_action_ = true;
+
+  // Stores an indication of if current input is in form tag.
+  bool text_input_is_in_form_tag_ = false;
+#endif
+
   // Delayed callback to ensure we have only one delayed ScheduleAnimation()
   // call going at a time.
   TaskRunnerTimer<WidgetBase> request_animation_after_delay_timer_;
   // Delayed callback to ensure we have only one delayed ScheduleAnimation()
   // call going at a time.
   TaskRunnerTimer<WidgetBase> request_animation_after_delay_timer_;
index c7b0b2e..749b0d0 100644 (file)
@@ -660,6 +660,8 @@ ui::EflEventHandler* RWHVAuraOffscreenHelperEfl::GetEventHandler() {
 }
 
 ui::IMContextEfl* RWHVAuraOffscreenHelperEfl::GetIMContextEfl() {
 }
 
 ui::IMContextEfl* RWHVAuraOffscreenHelperEfl::GetIMContextEfl() {
+  // im_context_efl_ is always nullptr on desktop efl.
+#if BUILDFLAG(IS_TIZEN)
   if (!im_context_efl_) {
     if (GetEventHandler() && GetEventHandler()->GetIMContextEfl()) {
       im_context_efl_ = GetEventHandler()->GetIMContextEfl();
   if (!im_context_efl_) {
     if (GetEventHandler() && GetEventHandler()->GetIMContextEfl()) {
       im_context_efl_ = GetEventHandler()->GetIMContextEfl();
@@ -668,6 +670,7 @@ ui::IMContextEfl* RWHVAuraOffscreenHelperEfl::GetIMContextEfl() {
     }
     LOG(ERROR) << "im_context_efl_ is not set";
   }
     }
     LOG(ERROR) << "im_context_efl_ is not set";
   }
+#endif
   return im_context_efl_;
 }
 
   return im_context_efl_;
 }
 
@@ -680,6 +683,80 @@ gfx::Point RWHVAuraOffscreenHelperEfl::ConvertPointInViewPix(gfx::Point point) {
       gfx::ScalePoint(gfx::PointF(point), device_scale_factor_));
 }
 
       gfx::ScalePoint(gfx::PointF(point), device_scale_factor_));
 }
 
+void RWHVAuraOffscreenHelperEfl::TextInputStateChanged(
+    const ui::mojom::TextInputState& params) {
+  auto im_context = GetIMContextEfl();
+  if (!im_context) {
+    LOG(ERROR) << "im_context is nullptr";
+    return;
+  }
+
+#if BUILDFLAG(IS_TIZEN_TV)
+  if (!rwhv_aura_->IsShowing() || !HasFocus())
+#else
+  if (!rwhv_aura_->IsShowing())
+#endif
+    return;
+
+  bool show_ime_if_needed = params.show_ime_if_needed;
+
+  if (show_ime_if_needed && !params.is_user_action)
+    show_ime_if_needed = false;
+
+  // Prevent scroll and zoom for autofocus'ed elements.
+  if (show_ime_if_needed && params.type != ui::TEXT_INPUT_TYPE_NONE) {
+    // If webview isn't resized yet, return previous IME state.
+    bool is_ime_show = im_context->WebViewWillBeResized()
+                           ? !im_context->IsVisible()
+                           : im_context->IsVisible();
+    if (im_context && !is_ime_show)
+      is_scrolling_needed_ = true;
+  }
+
+  if (im_context) {
+    im_context->SetIsInFormTag(params.is_in_form_tag);
+#if BUILDFLAG(IS_TIZEN_TV)
+    im_context->UpdateInputMethodState(
+        params.type, params.can_compose_inline, show_ime_if_needed,
+        password_input_minlength_, input_maxlength_);
+#else
+    im_context->UpdateInputMethodState(params.type, params.can_compose_inline,
+                                       show_ime_if_needed);
+#endif
+  }
+}
+
+void RWHVAuraOffscreenHelperEfl::FocusedNodeChanged(
+    bool editable
+#if BUILDFLAG(IS_TIZEN_TV)
+    ,
+    bool is_radio_or_checkbox,
+    int password_input_minlength,
+    int input_maxlength
+#endif
+) {
+
+#if BUILDFLAG(IS_TIZEN_TV)
+  radio_or_checkbox_focused_ = is_radio_or_checkbox;
+  password_input_minlength_ = password_input_minlength;
+  input_maxlength_ = input_maxlength;
+#endif
+
+  auto im_context = GetIMContextEfl();
+  if (im_context && is_focused_node_editable_) {
+    // focus out from an editable node,
+    // need reset ime context.
+    // or else will cause previous preedit text be copied.
+    if (im_context->IsVisible()) {
+      im_context->CancelComposition();
+    } else {
+      // add ime focus out when focus out from an editable node.
+      im_context->OnFocusOut();
+    }
+  }
+  is_focused_node_editable_ = editable;
+}
+
 gfx::Size RWHVAuraOffscreenHelperEfl::GetPhysicalBackingSize() const {
   int w, h;
   evas_object_geometry_get(content_image_elm_host_, nullptr, nullptr, &w, &h);
 gfx::Size RWHVAuraOffscreenHelperEfl::GetPhysicalBackingSize() const {
   int w, h;
   evas_object_geometry_get(content_image_elm_host_, nullptr, nullptr, &w, &h);
index 004a800..c4c91f6 100644 (file)
 #include "ui/gfx/native_widget_types.h"
 #include "ui/gfx/range/range.h"
 
 #include "ui/gfx/native_widget_types.h"
 #include "ui/gfx/range/range.h"
 
+#if BUILDFLAG(IS_TIZEN_TV)
+#define DEFAULT_MAX_LENGTH std::numeric_limits<int>::max()
+#endif
+
 namespace ui {
 class EflEventHandler;
 class IMContextEfl;
 namespace ui {
 class EflEventHandler;
 class IMContextEfl;
@@ -67,6 +71,14 @@ class CONTENT_EXPORT RWHVAuraOffscreenHelperEfl {
   bool HasFocus();
   void SetPageVisibility(bool visible);
   void TextInputStateChanged(const ui::mojom::TextInputState& params);
   bool HasFocus();
   void SetPageVisibility(bool visible);
   void TextInputStateChanged(const ui::mojom::TextInputState& params);
+  void FocusedNodeChanged(bool editable
+#if BUILDFLAG(IS_TIZEN_TV)
+                          ,
+                          bool is_radio_or_checkbox,
+                          int password_input_minlength,
+                          int input_maxlength
+#endif
+  );
 
   RenderWidgetHostViewAura* rwhva() { return rwhv_aura_; }
   void OnMouseOrTouchEvent(ui::Event* event);
 
   RenderWidgetHostViewAura* rwhva() { return rwhv_aura_; }
   void OnMouseOrTouchEvent(ui::Event* event);
@@ -134,6 +146,14 @@ class CONTENT_EXPORT RWHVAuraOffscreenHelperEfl {
   gfx::SizeF scaled_contents_size_;
   gfx::Size custom_viewport_size_;
 
   gfx::SizeF scaled_contents_size_;
   gfx::Size custom_viewport_size_;
 
+#if BUILDFLAG(IS_TIZEN_TV)
+  bool radio_or_checkbox_focused_ = false;
+  int password_input_minlength_ = -1;
+  int input_maxlength_ = DEFAULT_MAX_LENGTH;
+#endif
+  bool is_focused_node_editable_ = false;
+  bool is_scrolling_needed_ = false;
+
   ui::IMContextEfl* im_context_efl_ = nullptr;
   RenderWidgetHostViewAura* rwhv_aura_ = nullptr;
   WebContents* web_contents_ = nullptr;
   ui::IMContextEfl* im_context_efl_ = nullptr;
   RenderWidgetHostViewAura* rwhv_aura_ = nullptr;
   WebContents* web_contents_ = nullptr;
index 34162ad..4bda2bd 100644 (file)
@@ -42,13 +42,22 @@ void EflInputMethodContext::Reset() {
 }
 
 void EflInputMethodContext::Focus() {
 }
 
 void EflInputMethodContext::Focus() {
+#if !BUILDFLAG(IS_TIZEN_TV)
   if (im_context_ && !im_context_->IsVisible())
     im_context_->ShowPanel();
   if (im_context_ && !im_context_->IsVisible())
     im_context_->ShowPanel();
+#else
+  if (im_context_ && !im_context_->IsFocused())
+    im_context_->OnFocusIn();
+#endif
 }
 
 void EflInputMethodContext::Blur() {
   if (im_context_ && im_context_->IsVisible())
     im_context_->HidePanel();
 }
 
 void EflInputMethodContext::Blur() {
   if (im_context_ && im_context_->IsVisible())
     im_context_->HidePanel();
+#if BUILDFLAG(IS_TIZEN_TV)
+  else if (im_context_ && im_context_->IsFocused())
+    im_context_->OnFocusOut();
+#endif
 }
 
 void EflInputMethodContext::SetCursorLocation(const gfx::Rect& rect) {
 }
 
 void EflInputMethodContext::SetCursorLocation(const gfx::Rect& rect) {
index ee4542e..a83ceac 100644 (file)
@@ -8,6 +8,26 @@
 
 namespace ui {
 
 
 namespace ui {
 
+// TV RC device names
+const std::string kDeviceNameSmartView = "SMART_VIEW";
+const std::string kDeviceNamePanelKey = "wt61p807 panel key device";
+const std::string kDeviceNameRemote = "wt61p807 rc device";
+const std::string kDeviceNameSmartRC = "Smart Control";
+// To allow to receive Tomato send key events
+const std::string kDeviceNameAutoModeDevice = "AUTO_MODE_DEVICE";
+const std::string kDeviceNameIME = "ime";
+
+bool IsRCDevice(Evas_Device_Class device_id, const std::string device_name) {
+  if (device_id == EVAS_DEVICE_CLASS_KEYBOARD) {
+    return (!device_name.compare(kDeviceNameRemote) ||
+            !device_name.compare(kDeviceNameSmartView) ||
+            !device_name.compare(kDeviceNamePanelKey) ||
+            !device_name.compare(kDeviceNameAutoModeDevice) ||
+            device_name.find(kDeviceNameSmartRC) != std::string::npos);
+  }
+  return false;
+}
+
 static ui::KeyboardCode UIKeyCodeFromEflKey(const char* key) {
   static std::unordered_map<std::string, ui::KeyboardCode> code_from_key_map({
     {"Shift_L", ui::VKEY_SHIFT}, {"Shift_R", ui::VKEY_SHIFT},
 static ui::KeyboardCode UIKeyCodeFromEflKey(const char* key) {
   static std::unordered_map<std::string, ui::KeyboardCode> code_from_key_map({
     {"Shift_L", ui::VKEY_SHIFT}, {"Shift_R", ui::VKEY_SHIFT},
index 234085f..e728f1d 100644 (file)
 #include "ui/ozone/platform/efl/efl_platform_event_source.h"
 #include "ui/ozone/platform/efl/efl_window.h"
 
 #include "ui/ozone/platform/efl/efl_platform_event_source.h"
 #include "ui/ozone/platform/efl/efl_window.h"
 
+#if BUILDFLAG(IS_TIZEN_TV)
+#include "tizen_src/ewk/efl_integration/common/application_type.h"
+#endif
+
 #ifdef IM_CTX_DEBUG
 #define IM_CTX_LOG_CHANNEL LOG(ERROR)
 #else
 #ifdef IM_CTX_DEBUG
 #define IM_CTX_LOG_CHANNEL LOG(ERROR)
 #else
@@ -247,6 +251,10 @@ void IMContextEfl::UpdateInputMethodType(TextInputType type,
   }
 
 #if BUILDFLAG(IS_TIZEN_TV)
   }
 
 #if BUILDFLAG(IS_TIZEN_TV)
+  // 2017 WebBrowser App want no recommended list same as 2015, 2016.
+  if (content::IsWebBrowser())
+    allow_prediction = false;
+
   // Always enable "Up" and "Down" key
   // Set IMEUp=2, IMEDown=2 will always enable the 'up' and 'down' arrow key
   std::string im_data("IMEUp=2&IMEDown=2");
   // Always enable "Up" and "Down" key
   // Set IMEUp=2, IMEDown=2 will always enable the 'up' and 'down' arrow key
   std::string im_data("IMEUp=2&IMEDown=2");
@@ -511,6 +519,17 @@ void IMContextEfl::SendFakeCompositionKeyEvent(const std::u16string& buf) {
   if (event.key_code() == 0)
     event.set_key_code(static_cast<KeyboardCode>(229));
 
   if (event.key_code() == 0)
     event.set_key_code(static_cast<KeyboardCode>(229));
 
+#if BUILDFLAG(IS_TIZEN_TV)
+  if (content::IsTIZENWRT()) {
+    // a-z, A-Z, 0-9
+    int key_code = event.key_code();
+    if ((key_code >= 65 && key_code <= 90) ||
+        (key_code >= 48 && key_code <= 57)) {
+      event.set_key_code(static_cast<KeyboardCode>(229));
+    }
+  }
+#endif
+
   is_keyevent_processing_ = true;
   PushToKeyUpEventQueue(event.key_code());
   EflPlatformEventSource::GetInstance()->DispatchEflEvent(&event);
   is_keyevent_processing_ = true;
   PushToKeyUpEventQueue(event.key_code());
   EflPlatformEventSource::GetInstance()->DispatchEflEvent(&event);
index 956712c..9799fdb 100644 (file)
@@ -76,6 +76,11 @@ mojom("mojom") {
   export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
   export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
   export_header_blink = "third_party/blink/public/platform/web_common.h"
   export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
   export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
   export_header_blink = "third_party/blink/public/platform/web_common.h"
+
+  enabled_features = []
+  if (use_efl) {
+    enabled_features += [ "is_efl" ]
+  }
 }
 
 mojom("test_interfaces") {
 }
 
 mojom("test_interfaces") {
index 1c5e065..c86a2c7 100644 (file)
@@ -77,5 +77,12 @@ struct TextInputState {
 
   // Information of ime text spans at the cursor position.
   array<ImeTextSpanInfo> ime_text_spans_info;
 
   // Information of ime text spans at the cursor position.
   array<ImeTextSpanInfo> ime_text_spans_info;
+
+  [EnableIf=is_efl]
+  bool is_in_form_tag = false;
+
+  // Whether the focus is by user gesture.
+  [EnableIf=is_efl]
+  bool is_user_action = true;
 };
 
 };
 
index 5273703..6c0e434 100644 (file)
@@ -30,10 +30,19 @@ namespace {
 void ApppendEventDetails(const WebKeyboardEvent& event, std::string* result) {
   StringAppendF(result,
                 "{\n WinCode: %d\n NativeCode: %d\n IsSystem: %d\n"
 void ApppendEventDetails(const WebKeyboardEvent& event, std::string* result) {
   StringAppendF(result,
                 "{\n WinCode: %d\n NativeCode: %d\n IsSystem: %d\n"
+#if BUILDFLAG(IS_TIZEN_TV)
+                " Text: %s\n UnmodifiedText: %s\n"
+                " IsFromRc: %d\n DeviceName: %s\n}",
+                event.windows_key_code, event.native_key_code,
+                event.is_system_key, reinterpret_cast<const char*>(event.text),
+                reinterpret_cast<const char*>(event.unmodified_text),
+                event.is_from_rc, event.device_name);
+#else
                 " Text: %s\n UnmodifiedText: %s\n}",
                 event.windows_key_code, event.native_key_code,
                 event.is_system_key, reinterpret_cast<const char*>(event.text),
                 reinterpret_cast<const char*>(event.unmodified_text));
                 " Text: %s\n UnmodifiedText: %s\n}",
                 event.windows_key_code, event.native_key_code,
                 event.is_system_key, reinterpret_cast<const char*>(event.text),
                 reinterpret_cast<const char*>(event.unmodified_text));
+#endif
 }
 
 void ApppendEventDetails(const WebMouseEvent& event, std::string* result) {
 }
 
 void ApppendEventDetails(const WebMouseEvent& event, std::string* result) {
index faf8d8e..2721ef0 100644 (file)
 #include "ui/events/keycodes/platform_key_map_win.h"
 #endif
 
 #include "ui/events/keycodes/platform_key_map_win.h"
 #endif
 
+#if BUILDFLAG(IS_TIZEN_TV)
+#include "tizen/system_info.h"
+#endif
+
 namespace ui {
 namespace {
 
 namespace ui {
 namespace {
 
@@ -1097,6 +1101,14 @@ char16_t KeyEvent::GetText() const {
 char16_t KeyEvent::GetUnmodifiedText() const {
   if (!is_char_ && (key_code_ == VKEY_RETURN))
     return '\r';
 char16_t KeyEvent::GetUnmodifiedText() const {
   if (!is_char_ && (key_code_ == VKEY_RETURN))
     return '\r';
+
+#if BUILDFLAG(IS_TIZEN_TV)
+  if (key_code_ == VKEY_IME_DONE)
+    return '\r';
+  else if (key_code_ == 0)
+    return 0;
+#endif
+
   return GetCharacter();
 }
 
   return GetCharacter();
 }
 
index 22ef547..e8f04f4 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef UI_EVENTS_KEYCODES_KEYBOARD_CODES_POSIX_H_
 #define UI_EVENTS_KEYCODES_KEYBOARD_CODES_POSIX_H_
 
 #ifndef UI_EVENTS_KEYCODES_KEYBOARD_CODES_POSIX_H_
 #define UI_EVENTS_KEYCODES_KEYBOARD_CODES_POSIX_H_
 
+#include "build/build_config.h"
+
 namespace ui {
 
 // When adding a new KeyboardCode, be sure to also update the associated mojom
 namespace ui {
 
 // When adding a new KeyboardCode, be sure to also update the associated mojom
@@ -253,6 +255,13 @@ enum KeyboardCode {
   VKEY_DICTATE = 0xEE,
   // All applications - this also triggers the launcher in Chrome OS.
   VKEY_ALL_APPLICATIONS = 0xEF,
   VKEY_DICTATE = 0xEE,
   // All applications - this also triggers the launcher in Chrome OS.
   VKEY_ALL_APPLICATIONS = 0xEF,
+
+#if BUILDFLAG(IS_TIZEN_TV)
+  // TV IME "Select" key, no X Server keycode, 0xFF60 ISF code.
+  VKEY_IME_DONE = 0xFF60,
+  // TV IME "Cancel" key, no X Server keycode, 0xFF69 ISF code.
+  VKEY_IME_CANCEL = 0xFF69,
+#endif
 };
 
 }  // namespace ui
 };
 
 }  // namespace ui