efl_helper_->CloseQRCode();
}
}
+std::u16string RenderWidgetHostViewAura::GetSelectionText() {
+ if (GetTextInputManager() && GetTextInputManager()->GetTextSelection(this)) {
+ return GetTextInputManager()->GetTextSelection(this)->text();
+ }
+ return std::u16string();
+}
#endif
#if BUILDFLAG(IS_WIN)
input_method->CancelComposition(this);
has_composition_text_ = false;
-#if defined(USE_EFL)
+#if BUILDFLAG(IS_EFL)
if (efl_helper_) {
efl_helper_->FocusedNodeChanged(
#if BUILDFLAG(IS_TIZEN_TV)
,
bool is_radio_or_checkbox
#endif
-#if defined(USE_EFL)
+#if BUILDFLAG(IS_EFL)
,
bool is_content_editable
#endif
#if BUILDFLAG(IS_EFL)
void DisplayQRCode(std::string contents) override;
void CloseQRCode() override;
+ // Returns the text including the selection which might include
+ // several characters before and after it.
+ std::u16string GetSelectionText();
#endif
// May be overridden in tests.
setenv("HOME", homedir.value().c_str(), 1);
#endif
-#if defined(USE_EFL) && defined(TIZEN_PEPPER_EXTENSIONS)
+#if defined(TIZEN_PEPPER_EXTENSIONS)
base::SingleThreadTaskExecutor main_thread_task_executor(
base::MessagePumpType::ECORE);
#else
#endif
elm_object_tree_focus_allow_set(popup_, false);
} else {
- top_widget_ =
- elm_object_top_widget_get(elm_object_parent_widget_get(ewk_view()));
+ if (auto parent = elm_object_parent_widget_get(ewk_view()))
+ top_widget_ = elm_object_top_widget_get(parent);
+ else
+ top_widget_ = elm_object_top_widget_get(ewk_view());
evas_object_data_set(top_widget_, "ContextMenuContollerEfl", this);
popup_ = elm_popup_add(top_widget_);
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/range/range.h"
-class EWebView;
-
namespace content {
class RenderWidgetHostViewAura;
#endif
if (GetSelectionStatus())
- ClearSelectionViaEWebView();
+ ClearSelectionViaWebViewDelegate();
HideHandleAndContextMenu();
if (rwhva_->offscreen_helper()) {
return;
if (selection_controller->GetSelectionStatus())
- selection_controller->ClearSelectionViaEWebView();
+ selection_controller->ClearSelectionViaWebViewDelegate();
selection_controller->HideHandleAndContextMenu();
}
#endif
selection_data_->UpdateSelectStringData(text);
}
-bool SelectionControllerEfl::ClearSelectionViaEWebView() {
+bool SelectionControllerEfl::ClearSelectionViaWebViewDelegate() {
if (!GetSelectionStatus() || !web_contents()->GetRenderViewHost() ||
web_contents()->IsBeingDestroyed()) {
return false;
// TODO(a1.gomes): In case of EWK apps, the call below end up calling
// EWebView::ShowContextMenu. We have to make sure parameters
// are correct.
+ // In case of WRTJS, this ends up calling ShowContextMenu but
+ // through WRTJS components similar to EWebView's implementation
WebContentsImpl* wci = static_cast<WebContentsImpl*>(web_contents());
if (!wci || !wci->GetEflDelegate()) {
return;
point = rwhva_->aura_efl_helper()->ConvertPointInViewPix(point);
switch (type) {
case ui::ET_GESTURE_LONG_PRESS: {
- ClearSelectionViaEWebView();
+ ClearSelectionViaWebViewDelegate();
HideHandleAndContextMenu();
// Long press data will call to WebContentsViewDelegateEfl.
// It is called by the chain that handles FrameHostMsg_ContextMenu.
break;
}
default:
- ClearSelectionViaEWebView();
+ ClearSelectionViaWebViewDelegate();
break;
}
}
// Clears the selection and hides context menu and handles
void ClearSelection();
- bool ClearSelectionViaEWebView();
+ bool ClearSelectionViaWebViewDelegate();
void HideHandles();
void HideHandleAndContextMenu();
bool IsAnyHandleVisible() const;
if (GetSelectionController())
return GetSelectionController()
- ->ClearSelectionViaEWebView(); // LCOV_EXCL_LINE
+ ->ClearSelectionViaWebViewDelegate(); // LCOV_EXCL_LINE
return EINA_FALSE;
}
void WRTContextMenuController::MoveCaret(const gfx::Point& point) {
#if !defined(WRT_JS_BRINGUP)
- if (rwhva() && rwhva()->aura_efl_helper())
- rwhva()->aura_efl_helper()->MoveCaret(point);
+ if (rwhva() && rwhva()->offscreen_helper())
+ rwhva()->offscreen_helper()->MoveCaret(point);
#endif
}