SelectionController::OnMouse{Up,Move,Down} have broken signatures
authorAntonio Gomes <a1.gomes@samsung.com>
Fri, 18 Sep 2015 15:11:17 +0000 (11:11 -0400)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
In all three methods, names are misleading.
Patch does the following:

- OnMouseDown -> HandleDragBeginNotification
- OnMoveMove -> HandleDragUpdateNotification
- OnMouseUp -> HandleDragEndNotification

Additionally, patch removes an unused parameter
in all three methods.

Original beta/m42 patch:
- http://165.213.202.130/gerrit/87893 , reviewed by
Hyunhak Kim, arno renevier.

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

Reviewed by: a.renevier, j.majnert, sns.park

Change-Id: Iea48026c242bdde6f65c0782369f30d5dadc233a
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/chromium_impl/content/browser/selection/selection_handle_efl.cc

index 05af862..bd387b3 100644 (file)
@@ -358,8 +358,7 @@ void SelectionControllerEfl::Clear(bool show_after_scroll) {
   input_handle_->Hide();
 }
 
-void SelectionControllerEfl::OnMouseDown(
-    const gfx::Point& touch_point, SelectionHandleEfl* handle) {
+void SelectionControllerEfl::HandleDragBeginNotification(SelectionHandleEfl* handle) {
   // Hide context menu on mouse down
   show_only_large_handle_ = false;
   CancelContextMenu(0);
@@ -403,8 +402,7 @@ void SelectionControllerEfl::OnMouseDown(
   ShowHandleAndContextMenuIfRequired();
 }
 
-void SelectionControllerEfl::OnMouseMove(const gfx::Point& touch_point,
-    SelectionHandleEfl* handle) {
+void SelectionControllerEfl::HandleDragUpdateNotification(SelectionHandleEfl* handle) {
   show_only_large_handle_ = false;
   // FIXME : Check the text Direction later
   Evas_Coord x, y;
@@ -439,7 +437,7 @@ void SelectionControllerEfl::OnMouseMove(const gfx::Point& touch_point,
   }
 }
 
-void SelectionControllerEfl::OnMouseUp(const gfx::Point& touch_point) {
+void SelectionControllerEfl::HandleDragEndNotification() {
   show_only_large_handle_ = false;
   mouse_press_ = false;
   magnifier_->Hide();
index 84d98d8..08d2fb3 100644 (file)
@@ -73,10 +73,11 @@ class CONTENT_EXPORT SelectionControllerEfl {
   bool UpdateSelectionDataAndShow(const gfx::Rect& left_rect,
       const gfx::Rect& right_rect, bool show = true);
   void GetSelectionBounds(gfx::Rect* left, gfx::Rect* right);
-  // Handles the mouse press,move and relase events on selection handles
-  void OnMouseDown(const gfx::Point& touch_point, SelectionHandleEfl*);
-  void OnMouseMove(const gfx::Point& touch_point, SelectionHandleEfl*);
-  void OnMouseUp(const gfx::Point& touch_point);
+
+  // Handles the touch press, move and relase events on selection handles
+  void HandleDragBeginNotification(SelectionHandleEfl*);
+  void HandleDragUpdateNotification(SelectionHandleEfl*);
+  void HandleDragEndNotification();
 
   void SetCaretSelectionStatus(const bool enable);
   bool GetCaretSelectionStatus() const;
index 775221b..cd9f975 100644 (file)
@@ -36,10 +36,7 @@ static const char* GetEdjeObjectGroupPath(SelectionHandleEfl::HandleType type) {
 }
 
 SelectionHandleEfl::SelectionHandleEfl(SelectionControllerEfl& controller, HandleType type, Evas_Object* parent)
-  : base_point_(0,0),
-    current_touch_point_(0,0),
-    diff_point_(0,0),
-    controller_(controller),
+  : controller_(controller),
     pressed_(false),
     is_top_(false),
     handle_type_(type) {
@@ -103,9 +100,7 @@ void SelectionHandleEfl::OnMouseDown(void* data, Evas*, Evas_Object*, void* even
   int delta_x = event->canvas.x - handle->diff_point_.x();
   int delta_y = event->canvas.y - handle->diff_point_.y();
   handle->base_point_.SetPoint(delta_x, delta_y);
-
-  handle->controller_.OnMouseDown(
-      gfx::Point(event->canvas.x , event->canvas.y), handle);
+  handle->controller_.HandleDragBeginNotification(handle);
 }
 
 void SelectionHandleEfl::OnMouseMove(void* data, Evas*, Evas_Object*, void* event_info) {
@@ -115,15 +110,12 @@ void SelectionHandleEfl::OnMouseMove(void* data, Evas*, Evas_Object*, void* even
   ecore_job_add(UpdateMouseMove, handle);
 }
 
-void SelectionHandleEfl::OnMouseUp(void* data, Evas*, Evas_Object*, void* event_info) {
-  Evas_Event_Mouse_Up* event = static_cast<Evas_Event_Mouse_Up*>(event_info);
+void SelectionHandleEfl::OnMouseUp(void* data, Evas*, Evas_Object*, void* /* event_info */) {
   SelectionHandleEfl* handle = static_cast<SelectionHandleEfl*>(data);
   handle->pressed_ = false;
   evas_object_event_callback_del(handle->handle_, EVAS_CALLBACK_MOUSE_MOVE, OnMouseMove);
 
-  Evas_Coord x, y;
-  evas_object_geometry_get(handle->controller_.GetParentView(), &x, &y, 0, 0);
-  handle->controller_.OnMouseUp(gfx::Point(event->canvas.x - x, event->canvas.y - y));
+  handle->controller_.HandleDragEndNotification();
 }
 
 void SelectionHandleEfl::UpdateMouseMove(void* data) {
@@ -132,9 +124,7 @@ void SelectionHandleEfl::UpdateMouseMove(void* data) {
   int delta_x = handle->current_touch_point_.x() - handle->diff_point_.x();
   int delta_y = handle->current_touch_point_.y() - handle->diff_point_.y();
   handle->base_point_.SetPoint(delta_x, delta_y);
-  handle->controller_.OnMouseMove(
-      gfx::Point(handle->current_touch_point_.x(),
-                 handle->current_touch_point_.y()), handle);
+  handle->controller_.HandleDragUpdateNotification(handle);
 }
 
 SelectionHandleEfl::HandleDirection SelectionHandleEfl::CalculateDirection(