const gfx::Range& range) {
if (range.start() == range.end() && GetIMContextEfl())
GetIMContextEfl()->SetCaretPosition(range.start());
+
+ if (!GetSelectionController())
+ return;
+
+ std::u16string selectedText;
+ if (!text.empty() && !range.is_empty())
+ selectedText = rwhv_aura_->GetSelectedText();
+ GetSelectionController()->UpdateSelectionData(selectedText);
}
void RWHVAuraOffscreenHelperEfl::EvasToBlinkCords(int x,
#include "base/callback.h"
#include "base/containers/id_map.h"
#include "base/timer/timer.h"
+#include "content/browser/selection/selection_controller_efl.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"
void SelectionChanged(const std::u16string& text,
size_t offset,
const gfx::Range& range);
+ SelectionControllerEfl* GetSelectionController() const {
+ return selection_controller_.get();
+ }
void EvasToBlinkCords(int x, int y, int* view_x, int* view_y);
Evas_Object* ewk_view() const;
ui::IMContextEfl* im_context_efl_ = nullptr;
RenderWidgetHostViewAura* rwhv_aura_ = nullptr;
WebContents* web_contents_ = nullptr;
+ std::unique_ptr<SelectionControllerEfl> selection_controller_;
std::unique_ptr<RenderWidgetHostHelper> rwh_helper_;
}
SelectionControllerEfl* EWebView::GetSelectionController() const {
-#if !defined(USE_AURA)
RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
- RenderWidgetHostViewEfl* view = static_cast<RenderWidgetHostViewEfl*>(
+ RenderWidgetHostViewAura* view = static_cast<RenderWidgetHostViewAura*>(
render_view_host->GetWidget()->GetView());
- return view ? view->GetSelectionController() : 0;
-#else
- return nullptr;
-#endif
+ return view ? view->offscreen_helper()->GetSelectionController() : 0;
}
void EWebView::SelectLinkText(const gfx::Point& touch_point) {
return EINA_FALSE;
ResetContextMenuController();
- rwhva()->SelectionChanged(std::u16string(), 0, gfx::Range());
+ rwhva()->offscreen_helper()->SelectionChanged(std::u16string(), 0,
+ gfx::Range());
if (GetSelectionController())
return GetSelectionController()->ClearSelectionViaEWebView();