Remove SelectionControllerEfl::IsCaretSelection and bogus logic
authorAntonio Gomes <a1.gomes@samsung.com>
Fri, 7 Aug 2015 17:20:24 +0000 (13:20 -0400)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
SelectionControllerEfl::caret_selection_ is meaningless
class member currently. It is supposed to store the state
of either text selection is in "caret mode" or not. But this
is done in SelectionBoxEfl::GetCaretSelectionStatus.

In fact, ::caret_selection_ is set to 'true' at the ctor,
then set to true again in ::HandleLongPressEventPrivate.
Any associated if that checks for it is bogus since it is always
true. That includes its getter SelectionControllerEfl::IsCaretSelection.

Patch removes the associated code, and also code paths
that were unreachable before.

Original beta/m42 patch:
- http://165.213.202.130/gerrit/#/c/84781/ reviewed by
Arnaud Renevier and Janusz Majnert

Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=14304

Reviewed by: Janusz Majnert, arno renevier, SeungSeop Park

Change-Id: Iadbcc11f0800ceb4490a2b0ce37ee079dd45ebbb
Signed-off-by: Antonio Gomes <a1.gomes@samsung.com>
tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.cc
tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.h
tizen_src/ewk/efl_integration/eweb_view.cc

index c6ba17f..f7dce57 100644 (file)
@@ -79,7 +79,6 @@ SelectionControllerEfl::SelectionControllerEfl(Evas_Object* parent_view, WebCont
        postponed_(false),
        expecting_update_(false),
        long_mouse_press_(false),
-       caret_selection_(true),
        selection_data_(new SelectionBoxEfl(parent_view)),
        start_handle_(new SelectionHandleEfl(*this, SelectionHandleEfl::HANDLE_TYPE_LEFT, parent_view)),
        end_handle_(new SelectionHandleEfl(*this, SelectionHandleEfl::HANDLE_TYPE_RIGHT, parent_view)),
@@ -660,17 +659,13 @@ void SelectionControllerEfl::HandleLongPressEventPrivate(const gfx::Point& touch
   show_only_large_handle_ = false;
   long_mouse_press_ = true;
   Clear();
-  caret_selection_ = true;
   if (selection_data_->IsInEditField())
     SetCaretSelectionStatus(true);
-  if (caret_selection_) {
-    Evas_Coord x, y;
-    evas_object_geometry_get(parent_view_, &x, &y, 0, 0);
-    magnifier_->HandleLongPress(gfx::Point(touch_point.x() + x,
-                                           touch_point.y() + y));
-  } else {
-    long_mouse_press_ = false;
-  }
+
+  Evas_Coord x, y;
+  evas_object_geometry_get(parent_view_, &x, &y, 0, 0);
+  magnifier_->HandleLongPress(gfx::Point(touch_point.x() + x,
+                                         touch_point.y() + y));
 }
 
 void SelectionControllerEfl::HandleLongPressMoveEvent(const gfx::Point& touch_point) {
index 0287d38..083df89 100644 (file)
@@ -104,7 +104,6 @@ class CONTENT_EXPORT SelectionControllerEfl {
   void ChangeContextMenuPosition(gfx::Point& position, int& drawDirection);
 
   bool GetLongPressed() { return long_mouse_press_; }
-  bool IsCaretSelection() { return caret_selection_; }
 
   bool IsShowingMagnifier();
 
@@ -183,10 +182,6 @@ class CONTENT_EXPORT SelectionControllerEfl {
   // Saves state so that handlers and context menu is not shown when seletion change event occurs.
   bool long_mouse_press_;
 
-  // Saves state so that magnifier and context menu is not shown when
-  // long pressing should work like tap, e.g. press into editable field
-  bool caret_selection_;
-
   // Saves the data that are required to draw handle and context menu
   scoped_ptr<SelectionBoxEfl> selection_data_;
 
index 5d968e7..35749c4 100644 (file)
@@ -1130,8 +1130,7 @@ void EWebView::ShowContextMenu(
   context_menu_position_ = gfx::Point(convertedParams.x, convertedParams.y);
 
   if (GetSelectionController()) {
-    if (!GetSelectionController()->IsShowingMagnifier() &&
-        GetSelectionController()->IsCaretSelection()) {
+    if (!GetSelectionController()->IsShowingMagnifier()) {
       if(!context_menu_->PopulateAndShowContextMenu(convertedParams)) {
         context_menu_.reset();
         GetSelectionController()->HideHandles();