[NextBrowser] fixup! Navigation issue on long press 92/317892/2
authormayur.jain <mayur.jain@samsung.com>
Fri, 20 Sep 2024 07:14:51 +0000 (12:44 +0530)
committerBot Blink <blinkbot@samsung.com>
Fri, 20 Sep 2024 09:09:13 +0000 (09:09 +0000)
-On long press of direction-UP key in webview area
 of external pages,cursor timer keeps running till
 key release and reaches the top of webbrowser.
-Now deleting the timer when cursor reaches the
 native UI area, so that hybrid-navigation can
 start.

Change-Id: Ia079593592ecde488f7fdf1b84549379ea5d4bdf
Signed-off-by: mayur.jain <mayur.jain@samsung.com>
chrome/browser/ui/samsung/cursor_controller.cc

index 46608fe33ccae1808e4d6e6759bba52c245a1873..a6081352877efbd3cdf9246a6a2025890bb9e506 100644 (file)
@@ -39,6 +39,8 @@ constexpr double pointerMinRange = 8.0;
 constexpr double pointerOffsetMax = 50.0;
 constexpr double pointerMaxTime = 2.0;
 
+constexpr int webViewStartY = 73;
+
 CursorController::CursorController(Browser* browser)
     : browser_(browser),
       m_currentCursorImage(samsung_browser_main::CursorImage::WebDefault),
@@ -491,6 +493,15 @@ void CursorController::TimerPointerMove() {
       default:
         break;
     }
+    if (y < webViewStartY) {
+      LOG(INFO) << "End of normal pointer navigation in webview area";
+      m_cursorMoveParam.m_timer.Stop();
+      cursor_provider_->WarpPointerTo(x, webViewStartY - 1);
+      m_cursorCoordX = x;
+      m_cursorCoordY = webViewStartY - 1;
+      return;
+    }
+
     LOG(INFO) << "Moving Pointer to X: " << x << " Y: " << y;
     cursor_provider_->WarpPointerTo(x, y);
     m_cursorCoordX = x;  // to be removed after integration from inputManager