Fix whole link text selection
authorYoungbok Yoon <youngbok.yoon@samsung.com>
Wed, 14 May 2014 04:33:24 +0000 (13:33 +0900)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
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

tizen_src/impl/context_menu_controller_efl.cc
tizen_src/impl/context_menu_controller_efl.h
tizen_src/impl/eweb_view.cc [changed mode: 0755->0644]
tizen_src/impl/eweb_view.h [changed mode: 0755->0644]

index 7b5b259..d5f8b5b 100644 (file)
@@ -111,7 +111,7 @@ void ContextMenuControllerEfl::GetProposedContextMenu() {
                          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(),
@@ -256,6 +256,12 @@ void ContextMenuControllerEfl::MenuItemSelected(ContextMenuItemEfl *menu_item) {
       }
       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;
index a8b07bf..8f0d04c 100644 (file)
@@ -111,6 +111,7 @@ enum ContextMenuOption{
   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,
old mode 100755 (executable)
new mode 100644 (file)
index 0fa276d..d04d38f
@@ -1227,6 +1227,12 @@ void EWebView::SelectClosestWord(const gfx::Point& touch_point) {
   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;
old mode 100755 (executable)
new mode 100644 (file)
index 3d728b9..4926704
@@ -188,6 +188,7 @@ class EWebView
   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