return root_view->GetVisibleViewportSize();
}
+#if BUILDFLAG(IS_EFL)
+void RenderWidgetHostImpl::HandleKeyEvent(blink::WebInputEvent::Type type,
+ bool processed) {
+ if (!view_)
+ return;
+ view_->DidHandleKeyEvent(type, processed);
+}
+#endif
+
// This method was copied from RenderWidget::ConvertWindowToViewport() when
// porting drag-and-drop calls to Mojo, so that RenderWidgetHostImpl bypasses
// RenderWidget to talk the the WebFrameWidget and needs to perform the scale
const gfx::Rect& drag_obj_rect_in_dip,
blink::mojom::DragEventSourceInfoPtr event_info) override;
+#if BUILDFLAG(IS_EFL)
+ void HandleKeyEvent(blink::WebInputEvent::Type type, bool processed) override;
+#endif
+
// When the RenderWidget is destroyed and recreated, this resets states in the
// browser to match the clean start for the renderer side.
void ResetStateForCreatedRenderWidget(
if (offscreen_helper_)
offscreen_helper_->NotifySwap(texture_id);
}
+
+void RenderWidgetHostViewAura::DidHandleKeyEvent(
+ blink::WebInputEvent::Type input_event_type,
+ bool processed) {
+ if (offscreen_helper_)
+ offscreen_helper_->DidHandleKeyEvent(input_event_type, processed);
+}
+
+void RenderWidgetHostViewAura::SelectionChanged(const std::u16string& text,
+ size_t offset,
+ const gfx::Range& range) {
+ RenderWidgetHostViewBase::SelectionChanged(text, offset, range);
+
+ if (offscreen_helper_)
+ offscreen_helper_->SelectionChanged(text, offset, range);
+}
#endif
void RenderWidgetHostViewAura::EnsureSurfaceSynchronizedForWebTest() {
return offscreen_helper_.get();
}
void NotifySwap(const uint32_t texture_id);
+ void DidHandleKeyEvent(blink::WebInputEvent::Type input_event,
+ bool processed) override;
+ void SelectionChanged(const std::u16string& text,
+ size_t offset,
+ const gfx::Range& range) override;
#endif
protected:
// RenderWidgetHostView.
VisibleTimeRequestTrigger* GetVisibleTimeRequestTrigger();
+#if BUILDFLAG(IS_EFL)
+ virtual void DidHandleKeyEvent(blink::WebInputEvent::Type input_event,
+ bool processed) {}
+#endif
+
protected:
explicit RenderWidgetHostViewBase(RenderWidgetHost* host);
~RenderWidgetHostViewBase() override;
mojo::PendingAssociatedReceiver<blink::mojom::Widget>>
BindNewWidgetInterfaces();
+#if BUILDFLAG(IS_EFL)
+ void HandleKeyEvent(blink::WebInputEvent::Type type,
+ bool processed) override {}
+#endif
+
// blink::mojom::FrameWidgetHost overrides.
void AnimateDoubleTapZoomInMainFrame(const gfx::Point& tap_point,
const gfx::Rect& rect_to_zoom) override;
"//url/mojom:url_mojom_origin",
]
+ enabled_features = []
+ if (use_efl) {
+ enabled_features += [ "is_efl" ]
+ }
+
if (is_android) {
# Direct deps (instead of transitive deps) are necessary for java targets.
public_deps += [
[EnableIf=is_mac]
import "ui/base/mojom/attributed_string.mojom";
+[EnableIf=is_efl]
+import "third_party/blink/public/mojom/input/input_event.mojom";
+
// Implemented in Blink, this interface defines frame-widget-specific methods that
// will be invoked from the browser process (e.g. blink::WebFrameWidget).
interface FrameWidget {
gfx.mojom.Vector2d cursor_offset_in_dip,
gfx.mojom.Rect drag_obj_rect_in_dip,
DragEventSourceInfo event_info);
+
+ [EnableIf=is_efl]
+ HandleKeyEvent(EventType type, bool processed);
};
// Implemented in Browser, this interface defines popup-widget-specific methods
}
}
+#if BUILDFLAG(IS_TIZEN_TV)
+ if (event_->IsKeyboardEvent()) {
+ if (event_->defaultPrevented())
+ LOG(INFO) << "Keyboard event been defaultPrevented";
+ if (event_->DefaultHandled())
+ LOG(INFO) << "Keyboard event been DefaultHandled";
+ }
+#endif
+
// Call default event handlers. While the DOM does have a concept of
// preventing default handling, the detail of which handlers are called is an
// internal implementation detail and not part of the DOM.
bool Editor::HandleEditingKeyboardEvent(KeyboardEvent* evt) {
const WebKeyboardEvent* key_event = evt->KeyEvent();
- if (!key_event)
+ // do not treat this as text input if it's a system key event
+ if (!key_event || key_event->is_system_key)
return false;
String command_name = Behavior().InterpretKeyEvent(*evt);
}
}
+#if BUILDFLAG(IS_EFL)
+void WebFrameWidgetImpl::NotifyKeyEvent(WebInputEvent::Type type,
+ bool processed) {
+ GetAssociatedFrameWidgetHost()->HandleKeyEvent(type, processed);
+}
+#endif
+
} // namespace blink
// Ask compositor to create the shared memory for smoothness ukm region.
base::ReadOnlySharedMemoryRegion CreateSharedMemoryForSmoothnessUkm();
+#if BUILDFLAG(IS_EFL)
+ void NotifyKeyEvent(WebInputEvent::Type type, bool processed) override;
+#endif
+
protected:
// WidgetBaseClient overrides:
void ScheduleAnimation() override;
}
}
+#if BUILDFLAG(IS_EFL)
+ if (WebInputEvent::IsKeyboardEventType(input_event.GetType())) {
+ // This message is called for every IME key input.
+ // The current status of processing the input event is used to
+ // properly manage 'CommitQueue' or 'PreeditQueue' on impl side:
+ // If the event is not processed, 'ConfirmComposition' or 'SetComposition'
+ // is called for IME composition, and then pops event queue.
+ // If the event is processed instead, impl side just pops the queue.
+ widget_->client()->NotifyKeyEvent(
+ input_event.GetType(), processed != WebInputEventResult::kNotHandled);
+ }
+#endif
+
// Handling |input_event| is finished and further down, we might start
// handling injected scroll events. So, stop monitoring EventMetrics for
// |input_event| to avoid nested monitors.
// Whether to use ScrollPredictor to resample scroll events. This is false for
// web_tests to ensure that scroll deltas are not timing-dependent.
virtual bool AllowsScrollResampling() { return true; }
+
+#if BUILDFLAG(IS_EFL)
+ virtual void NotifyKeyEvent(WebInputEvent::Type type, bool processed) {}
+#endif
};
} // namespace blink
}
}
+void RWHVAuraOffscreenHelperEfl::DidHandleKeyEvent(
+ blink::WebInputEvent::Type input_event_type,
+ bool processed) {
+ if (!GetIMContextEfl())
+ return;
+
+ bool is_keydown = false;
+ switch (input_event_type) {
+ case blink::WebInputEvent::Type::kRawKeyDown:
+ case blink::WebInputEvent::Type::kKeyDown:
+ is_keydown = true;
+ case blink::WebInputEvent::Type::kKeyUp:
+ GetIMContextEfl()->HandleKeyEvent(is_keydown, processed);
+ }
+}
+
+void RWHVAuraOffscreenHelperEfl::SelectionChanged(const std::u16string& text,
+ size_t offset,
+ const gfx::Range& range) {
+ if (range.start() == range.end() && GetIMContextEfl())
+ GetIMContextEfl()->SetCaretPosition(range.start());
+}
+
void RWHVAuraOffscreenHelperEfl::EvasToBlinkCords(int x,
int y,
int* view_x,
#include "base/containers/id_map.h"
#include "base/timer/timer.h"
#include "content/common/cursors/webcursor.h"
+#include "third_party/blink/public/common/input/web_input_event.h"
#include "ui/base/ime/mojom/text_input_state.mojom-forward.h"
#include "ui/events/event.h"
#include "ui/gfx/geometry/size_f.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/gfx/range/range.h"
namespace ui {
class EflEventHandler;
RenderWidgetHostViewAura* rwhva() { return rwhv_aura_; }
void OnMouseOrTouchEvent(ui::Event* event);
+ void DidHandleKeyEvent(blink::WebInputEvent::Type input_event_type,
+ bool processed);
+ void SelectionChanged(const std::u16string& text,
+ size_t offset,
+ const gfx::Range& range);
void EvasToBlinkCords(int x, int y, int* view_x, int* view_y);
Evas_Object* ewk_view() const;
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
-#include "content/public/browser/native_web_keyboard_event.h"
#include "tizen/system_info.h"
#include "ui/base/ime/linux/linux_input_method_context_factory.h"
#include "ui/events/base_event_utils.h"
#include <queue>
#include "build/build_config.h"
-#include "content/public/browser/native_web_keyboard_event.h"
#include "ui/base/ime/composition_text.h"
#include "ui/base/ime/text_input_mode.h"
#include "ui/base/ime/text_input_type.h"
}
Eina_Bool EWebView::ClearSelection() {
-#if !defined(USE_AURA)
- if (!rwhv())
+ if (!rwhva())
return EINA_FALSE;
ResetContextMenuController();
- rwhv()->SelectionChanged(std::u16string(), 0, gfx::Range());
+ rwhva()->SelectionChanged(std::u16string(), 0, gfx::Range());
if (GetSelectionController())
return GetSelectionController()->ClearSelectionViaEWebView();
-#endif
+
return EINA_FALSE;
}
webkit_event.unmodified_text[0] = event.GetUnmodifiedText();
webkit_event.text[0] = event.GetText();
+#if BUILDFLAG(IS_EFL)
+ webkit_event.is_system_key = event.is_system_key;
+#endif
+
return webkit_event;
}
scan_code_(ScanCodeFromNative(native_event)),
#endif // defined(USE_OZONE)
code_(CodeFromNative(native_event)),
+#if BUILDFLAG(IS_EFL)
+ is_system_key(IsSystemKeyFromNative(native_event)),
+#endif
is_char_(IsCharFromNative(native_event)) {
#if defined(USE_OZONE)
DCHECK(native_event->IsKeyEvent());
VLOG(2) << "DomCode::NONE keycode=" << key_code_;
code = UsLayoutKeyboardCodeToDomCode(key_code_);
if (code == DomCode::NONE) {
+#if !BUILDFLAG(IS_TIZEN_TV)
+ // Setting DomKey::UNIDENTIFIED to |key_| will result in 'Unidentified'
+ // value for |event.key| in JS layer. Instead, it is better to display
+ // empty value '', as expected by VD.
key_ = DomKey::UNIDENTIFIED;
+#endif
return;
}
}
// keyboard) from a native event.
EVENTS_EXPORT DomCode CodeFromNative(const PlatformEvent& native_event);
+#if BUILDFLAG(IS_EFL)
+// Returns the |is_system_key| value from a native event.
+EVENTS_EXPORT bool IsSystemKeyFromNative(const PlatformEvent& native_event);
+#endif
+
// Returns true if the keyboard event is a character event rather than
// a keystroke event.
EVENTS_EXPORT bool IsCharFromNative(const PlatformEvent& native_event);
return event->code();
}
+#if BUILDFLAG(IS_EFL)
+bool IsSystemKeyFromNative(const PlatformEvent& native_event) {
+ const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event);
+ DCHECK(event->IsKeyEvent());
+ return event->is_system_key;
+}
+#endif
+
bool IsCharFromNative(const PlatformEvent& native_event) {
const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event);
DCHECK(event->IsKeyEvent());