Patch allows to select whole link text.
Issue: CBBROWSER-149, CBBROWSER-98, CBBROWSER-154
Change-Id: I0083bfede515fc55889296eb31bd01fb3a915e54
Conflicts:
src/third_party/WebKit/Source/web/WebFrameImpl.cpp
Conflicts:
impl/eweb_view.cc
std::string());
if (!params_.has_image_contents && !params_.link_url.is_empty())
AddItemToPropsedList(MENU_ITEM_TYPE_ACTION,
- MENU_ITEM_SELECT_WORD,
+ MENU_ITEM_SELECT_LINK,
std::string("Select Mode"),
params_.link_url.spec(),
params_.link_url.spec(),
}
break;
}
+ case MENU_ITEM_SELECT_LINK: {
+ Evas_Coord x, y;
+ evas_object_geometry_get(view->evas_object(), &x, &y, 0, 0);
+ view->SelectLinkText(gfx::Point(params_.x - x, params_.y - y));
+ break;
+ }
case MENU_ITEM_PASTE: {
view->ExecuteEditCommand("paste", NULL);
break;
MENU_ITEM_DICTATION_ALTERNATIVE,
MENU_ITEM_SELECT_ALL,
MENU_ITEM_SELECT_WORD,
+ MENU_ITEM_SELECT_LINK,
MENU_ITEM_TEXT_SELECTION_MODE,
MENU_ITEM_CLIPBOARD,
MENU_ITEM_DRAG,
render_view_host->Send(new EwkViewMsg_SelectClosestWord(render_view_host->GetRoutingID(), touch_point.x(), touch_point.y()));
}
+void EWebView::SelectLinkText(const gfx::Point& touch_point) {
+ float device_scale_factor = rwhv()->device_scale_factor();
+ RenderViewHost* render_view_host = web_contents_delegate_->web_contents()->GetRenderViewHost();
+ render_view_host->Send(new ViewMsg_SelectLinkText(render_view_host->GetRoutingID(), gfx::Point(touch_point.x()/device_scale_factor, touch_point.y()/device_scale_factor)));
+}
+
bool EWebView::GetSelectionRange(Eina_Rectangle* left_rect, Eina_Rectangle* right_rect) {
if (left_rect && right_rect) {
gfx::Rect left, right;
void QuerySelectionStyle();
void OnQuerySelectionStyleReply(const SelectionStylePrams& params);
void SelectClosestWord(const gfx::Point& touch_point);
+ void SelectLinkText(const gfx::Point& touch_point);
bool GetSelectionRange(Eina_Rectangle* left_rect, Eina_Rectangle* right_rect);
bool ClearSelection();
// Callback OnCopyFromBackingStore will be called once we get the snapshot from render