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
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;
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 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;
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() {
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();
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
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);
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 SelectionChanged(const std::u16string& text,
size_t offset,
const gfx::Range& range) override;
+ void TextInputStateChanged(const ui::mojom::TextInputState& params) override;
#endif
protected:
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();
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);
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};
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,
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))
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
// 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
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) {}
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.
if (is_android || is_mac) {
enabled_features += [ "is_using_open_color_chooser" ]
}
+ if (tizen_product_tv) {
+ enabled_features += [ "is_tizen_tv" ]
+ }
shared_cpp_typemaps = [
{
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).
//
// 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
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 {
// 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;
// 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,
#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();
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;
}
}
+ 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(
- 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,
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;
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
// 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,
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
unsigned which() const override;
bool isComposing() const { return is_composing_; }
+ const String inputDevice() const;
void Trace(Visitor*) const override;
private:
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,
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);
}
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
+#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);
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)) ||
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;
// 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
// 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_;
}
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();
}
LOG(ERROR) << "im_context_efl_ is not set";
}
+#endif
return im_context_efl_;
}
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);
#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;
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);
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;
}
void EflInputMethodContext::Focus() {
+#if !BUILDFLAG(IS_TIZEN_TV)
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();
+#if BUILDFLAG(IS_TIZEN_TV)
+ else if (im_context_ && im_context_->IsFocused())
+ im_context_->OnFocusOut();
+#endif
}
void EflInputMethodContext::SetCursorLocation(const gfx::Rect& rect) {
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},
#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
}
#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");
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);
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") {
// 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;
};
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));
+#endif
}
void ApppendEventDetails(const WebMouseEvent& event, std::string* result) {
#include "ui/events/keycodes/platform_key_map_win.h"
#endif
+#if BUILDFLAG(IS_TIZEN_TV)
+#include "tizen/system_info.h"
+#endif
+
namespace ui {
namespace {
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();
}
#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
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