From: Chandan Padhi Date: Tue, 3 Nov 2020 13:48:34 +0000 (+0530) Subject: Remove EWK_BRINGUP related to WebCursor X-Git-Tag: submit/tizen/20230227.160252~242 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F54%2F247654%2F2;p=platform%2Fframework%2Fweb%2Fchromium-efl.git Remove EWK_BRINGUP related to WebCursor This commit enables WebCursor related code under EWK_BRINGUP after making changes as per chromium upstream. Change-Id: I2c0b364c0155086d9d63a4894bad5436baa61838 Signed-off-by: Chandan Padhi (cherry picked from commit e756d39b2e6a4e1d7b1575f18d1dbd107e309e4e) --- diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc b/tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc index 6b9542c..431cc9e 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc +++ b/tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc @@ -659,7 +659,6 @@ void RenderWidgetHostViewEfl::OnDidHandleKeyEvent( } void RenderWidgetHostViewEfl::UpdateCursor(const WebCursor& webcursor) { -#if !defined(EWK_BRINGUP) // FIXME: m67 bringup if (is_loading_) { // Setting native Loading cursor #if defined(USE_WAYLAND) @@ -671,26 +670,24 @@ void RenderWidgetHostViewEfl::UpdateCursor(const WebCursor& webcursor) { #else ecore_x_window_cursor_set(GetEcoreXWindow(), ecore_x_cursor_shape_get(ECORE_X_CURSOR_CLOCK)); -#endif +#endif // defined(USE_WAYLAND) } else { - CursorInfo cursor_info; - webcursor.GetCursorInfo(&cursor_info); + const ui::Cursor& cursor = webcursor.cursor(); #if defined(USE_WAYLAND) #if TIZEN_VERSION_AT_LEAST(5, 0, 0) ecore_wl2_window_cursor_from_name_set(GetEcoreWlWindow(), - GetCursorName(cursor_info.type)); + GetCursorName(cursor.type())); #else ecore_wl_window_cursor_from_name_set(GetEcoreWlWindow(), - GetCursorName(cursor_info.type)); + GetCursorName(cursor.type())); #endif // TIZEN_VERSION_AT_LEAST(5, 0, 0) #else - int cursor_type = GetCursorType(cursor_info.type); + int cursor_type = GetCursorType(cursor.type()); ecore_x_window_cursor_set(GetEcoreXWindow(), ecore_x_cursor_shape_get(cursor_type)); -#endif +#endif // defined(USE_WAYLAND) } -#endif // EWK_BRINGUP } void RenderWidgetHostViewEfl::SetIsLoading(bool is_loading) { diff --git a/tizen_src/chromium_impl/content/common/cursors/webcursor_efl.cc b/tizen_src/chromium_impl/content/common/cursors/webcursor_efl.cc index a155967..b3e9b95 100644 --- a/tizen_src/chromium_impl/content/common/cursors/webcursor_efl.cc +++ b/tizen_src/chromium_impl/content/common/cursors/webcursor_efl.cc @@ -9,196 +9,158 @@ #include "base/logging.h" #if defined(USE_WAYLAND) -const char* GetCursorName(int type) { -#if defined(EWK_BRINGUP) // FIXME: m85 bringup - return "left_ptr"; -#else +const char* GetCursorName(ui::mojom::CursorType type) { switch (type) { - case WebCursorInfo::kTypePointer: - return "left_ptr"; - case WebCursorInfo::kTypeCross: - return "left_ptr"; // ECORE_X_CURSOR_CROSS - case WebCursorInfo::kTypeHand: + case ui::mojom::CursorType::kPointer: + case ui::mojom::CursorType::kCross: + case ui::mojom::CursorType::kHelp: + case ui::mojom::CursorType::kNone: + case ui::mojom::CursorType::kNotAllowed: + case ui::mojom::CursorType::kZoomIn: + case ui::mojom::CursorType::kZoomOut: + case ui::mojom::CursorType::kMiddlePanning: + case ui::mojom::CursorType::kMove: + case ui::mojom::CursorType::kCustom: + return "left_ptr"; // ECORE_X_CURSOR_FLEUR + case ui::mojom::CursorType::kHand: return "hand1"; - case WebCursorInfo::kTypeIBeam: + case ui::mojom::CursorType::kIBeam: + case ui::mojom::CursorType::kVerticalText: + case ui::mojom::CursorType::kCell: + case ui::mojom::CursorType::kContextMenu: + case ui::mojom::CursorType::kAlias: + case ui::mojom::CursorType::kNoDrop: + case ui::mojom::CursorType::kCopy: return "xterm"; - case WebCursorInfo::kTypeWait: + case ui::mojom::CursorType::kProgress: + case ui::mojom::CursorType::kWait: return "watch"; - case WebCursorInfo::kTypeHelp: - return "left_ptr"; // ECORE_X_CURSOR_QUESTION_ARROW - case WebCursorInfo::kTypeEastResize: - return "right_side"; - case WebCursorInfo::kTypeNorthResize: - return "top_side"; - case WebCursorInfo::kTypeNorthEastResize: - return "top_right_corner"; - case WebCursorInfo::kTypeNorthWestResize: - return "top_left_corner"; - case WebCursorInfo::kTypeSouthResize: - return "bottom_side"; - case WebCursorInfo::kTypeSouthEastResize: - return "bottom_right_corner"; - case WebCursorInfo::kTypeSouthWestResize: - return "bottom_left_corner"; - case WebCursorInfo::kTypeWestResize: - return "left_side"; - case WebCursorInfo::kTypeNorthSouthResize: - return "top_side"; // ECORE_X_CURSOR_SB_V_DOUBLE_ARROW - case WebCursorInfo::kTypeEastWestResize: - return "left_side"; // ECORE_X_CURSOR_SB_H_DOUBLE_ARROW - case WebCursorInfo::kTypeNorthEastSouthWestResize: - return "top_right_corner"; - case WebCursorInfo::kTypeNorthWestSouthEastResize: - return "top_left_corner"; - case WebCursorInfo::kTypeColumnResize: - return "left_side"; // ECORE_X_CURSOR_SB_H_DOUBLE_ARROW - case WebCursorInfo::kTypeRowResize: - return "top_side"; // ECORE_X_CURSOR_SB_V_DOUBLE_ARROW - case WebCursorInfo::kTypeMiddlePanning: - return "left_ptr"; // ECORE_X_CURSOR_FLEUR - case WebCursorInfo::kTypeEastPanning: - return "right_side"; // ECORE_X_CURSOR_SB_RIGHT_ARROW - case WebCursorInfo::kTypeNorthPanning: - return "top_side"; // ECORE_X_CURSOR_SB_UP_ARROW - case WebCursorInfo::kTypeNorthEastPanning: - return "top_right_corner"; // ECORE_X_CURSOR_TOP_RIGHT_CORNER - case WebCursorInfo::kTypeNorthWestPanning: - return "top_left_corner"; // ECORE_X_CURSOR_TOP_LEFT_CORNER - case WebCursorInfo::kTypeSouthPanning: - return "bottom_side"; // ECORE_X_CURSOR_SB_DOWN_ARROW - case WebCursorInfo::kTypeSouthEastPanning: - return "botton_right_corner"; // ECORE_X_CURSOR_BOTTOM_RIGHT_CORNER - case WebCursorInfo::kTypeSouthWestPanning: - return "botton_left_corner"; // ECORE_X_CURSOR_BOTTOM_LEFT_CORNER - case WebCursorInfo::kTypeWestPanning: - return "left_side"; //ECORE_X_CURSOR_SB_LEFT_ARROW - case WebCursorInfo::kTypeMove: - return "left_ptr"; //ECORE_X_CURSOR_FLEUR - case WebCursorInfo::kTypeVerticalText: - return "xterm"; - case WebCursorInfo::kTypeCell: - return "xterm"; - case WebCursorInfo::kTypeContextMenu: - return "xterm"; - case WebCursorInfo::kTypeAlias: - return "xterm"; - case WebCursorInfo::kTypeProgress: - return "watch"; - case WebCursorInfo::kTypeNoDrop: - return "xterm"; - case WebCursorInfo::kTypeCopy: - return "xterm"; - case WebCursorInfo::kTypeNone: - return "left_ptr"; - case WebCursorInfo::kTypeNotAllowed: - return "left_ptr"; - case WebCursorInfo::kTypeZoomIn: - return "left_ptr"; - case WebCursorInfo::kTypeZoomOut: - return "left_ptr"; - case WebCursorInfo::kTypeGrab: - case WebCursorInfo::kTypeGrabbing: + case ui::mojom::CursorType::kNorthResize: + case ui::mojom::CursorType::kRowResize: + case ui::mojom::CursorType::kNorthPanning: + case ui::mojom::CursorType::kNorthSouthResize: + return "top_side"; // ECORE_X_CURSOR_SB_V_DOUBLE_ARROW + case ui::mojom::CursorType::kEastResize: + case ui::mojom::CursorType::kEastPanning: + return "right_side"; // ECORE_X_CURSOR_SB_RIGHT_ARROW + case ui::mojom::CursorType::kSouthResize: + case ui::mojom::CursorType::kSouthPanning: + return "bottom_side"; // ECORE_X_CURSOR_SB_DOWN_ARROW + case ui::mojom::CursorType::kWestResize: + case ui::mojom::CursorType::kEastWestResize: + case ui::mojom::CursorType::kColumnResize: + case ui::mojom::CursorType::kWestPanning: + return "left_side"; // ECORE_X_CURSOR_SB_H_DOUBLE_ARROW + case ui::mojom::CursorType::kNorthEastResize: + case ui::mojom::CursorType::kNorthEastPanning: + case ui::mojom::CursorType::kNorthEastSouthWestResize: + return "top_right_corner"; // ECORE_X_CURSOR_TOP_RIGHT_CORNER + case ui::mojom::CursorType::kNorthWestResize: + case ui::mojom::CursorType::kNorthWestPanning: + case ui::mojom::CursorType::kNorthWestSouthEastResize: + return "top_left_corner"; // ECORE_X_CURSOR_TOP_LEFT_CORNER + case ui::mojom::CursorType::kSouthEastResize: + case ui::mojom::CursorType::kSouthEastPanning: + return "bottom_right_corner"; // ECORE_X_CURSOR_BOTTOM_RIGHT_CORNER + case ui::mojom::CursorType::kSouthWestResize: + case ui::mojom::CursorType::kSouthWestPanning: + return "bottom_left_corner"; // ECORE_X_CURSOR_BOTTOM_LEFT_CORNER + case ui::mojom::CursorType::kGrab: + case ui::mojom::CursorType::kGrabbing: return "grabbing"; - case WebCursorInfo::kTypeCustom: - return "left_ptr"; } NOTREACHED(); return "left_ptr"; -#endif // EWK_BRINGUP } #else -int GetCursorType(int type) { -#if defined(EWK_BRINGUP) // FIXME: m85 bringup - return ECORE_X_CURSOR_XTERM; -#else +int GetCursorType(ui::mojom::CursorType type) { switch (type) { - case WebCursorInfo::kTypePointer: + case ui::mojom::CursorType::kPointer: return ECORE_X_CURSOR_ARROW; - case WebCursorInfo::kTypeCross: + case ui::mojom::CursorType::kCross: return ECORE_X_CURSOR_CROSS; - case WebCursorInfo::kTypeHand: + case ui::mojom::CursorType::kHand: return ECORE_X_CURSOR_HAND2; - case WebCursorInfo::kTypeIBeam: + case ui::mojom::CursorType::kIBeam: return ECORE_X_CURSOR_XTERM; - case WebCursorInfo::kTypeWait: + case ui::mojom::CursorType::kWait: return ECORE_X_CURSOR_WATCH; - case WebCursorInfo::kTypeHelp: + case ui::mojom::CursorType::kHelp: return ECORE_X_CURSOR_QUESTION_ARROW; - case WebCursorInfo::kTypeEastResize: + case ui::mojom::CursorType::kEastResize: return ECORE_X_CURSOR_RIGHT_SIDE; - case WebCursorInfo::kTypeNorthResize: + case ui::mojom::CursorType::kNorthResize: return ECORE_X_CURSOR_TOP_SIDE; - case WebCursorInfo::kTypeNorthEastResize: + case ui::mojom::CursorType::kNorthEastResize: return ECORE_X_CURSOR_TOP_RIGHT_CORNER; - case WebCursorInfo::kTypeNorthWestResize: + case ui::mojom::CursorType::kNorthWestResize: return ECORE_X_CURSOR_TOP_LEFT_CORNER; - case WebCursorInfo::kTypeSouthResize: + case ui::mojom::CursorType::kSouthResize: return ECORE_X_CURSOR_BOTTOM_SIDE; - case WebCursorInfo::kTypeSouthEastResize: + case ui::mojom::CursorType::kSouthEastResize: return ECORE_X_CURSOR_BOTTOM_RIGHT_CORNER; - case WebCursorInfo::kTypeSouthWestResize: + case ui::mojom::CursorType::kSouthWestResize: return ECORE_X_CURSOR_BOTTOM_LEFT_CORNER; - case WebCursorInfo::kTypeWestResize: + case ui::mojom::CursorType::kWestResize: return ECORE_X_CURSOR_LEFT_SIDE; - case WebCursorInfo::kTypeNorthSouthResize: + case ui::mojom::CursorType::kNorthSouthResize: return ECORE_X_CURSOR_SB_V_DOUBLE_ARROW; - case WebCursorInfo::kTypeEastWestResize: + case ui::mojom::CursorType::kEastWestResize: return ECORE_X_CURSOR_SB_H_DOUBLE_ARROW; - case WebCursorInfo::kTypeNorthEastSouthWestResize: - case WebCursorInfo::kTypeNorthWestSouthEastResize: + case ui::mojom::CursorType::kNorthEastSouthWestResize: + case ui::mojom::CursorType::kNorthWestSouthEastResize: // There isn't really a useful cursor available for these. return ECORE_X_CURSOR_XTERM; - case WebCursorInfo::kTypeColumnResize: + case ui::mojom::CursorType::kColumnResize: return ECORE_X_CURSOR_SB_H_DOUBLE_ARROW; // TODO(evanm): is this correct? - case WebCursorInfo::kTypeRowResize: + case ui::mojom::CursorType::kRowResize: return ECORE_X_CURSOR_SB_V_DOUBLE_ARROW; // TODO(evanm): is this correct? - case WebCursorInfo::kTypeMiddlePanning: + case ui::mojom::CursorType::kMiddlePanning: return ECORE_X_CURSOR_FLEUR; - case WebCursorInfo::kTypeEastPanning: + case ui::mojom::CursorType::kEastPanning: return ECORE_X_CURSOR_SB_RIGHT_ARROW; - case WebCursorInfo::kTypeNorthPanning: + case ui::mojom::CursorType::kNorthPanning: return ECORE_X_CURSOR_SB_UP_ARROW; - case WebCursorInfo::kTypeNorthEastPanning: + case ui::mojom::CursorType::kNorthEastPanning: return ECORE_X_CURSOR_TOP_RIGHT_CORNER; - case WebCursorInfo::kTypeNorthWestPanning: + case ui::mojom::CursorType::kNorthWestPanning: return ECORE_X_CURSOR_TOP_LEFT_CORNER; - case WebCursorInfo::kTypeSouthPanning: + case ui::mojom::CursorType::kSouthPanning: return ECORE_X_CURSOR_SB_DOWN_ARROW; - case WebCursorInfo::kTypeSouthEastPanning: + case ui::mojom::CursorType::kSouthEastPanning: return ECORE_X_CURSOR_BOTTOM_RIGHT_CORNER; - case WebCursorInfo::kTypeSouthWestPanning: + case ui::mojom::CursorType::kSouthWestPanning: return ECORE_X_CURSOR_BOTTOM_LEFT_CORNER; - case WebCursorInfo::kTypeWestPanning: + case ui::mojom::CursorType::kWestPanning: return ECORE_X_CURSOR_SB_LEFT_ARROW; - case WebCursorInfo::kTypeMove: + case ui::mojom::CursorType::kMove: return ECORE_X_CURSOR_FLEUR; - case WebCursorInfo::kTypeVerticalText: + case ui::mojom::CursorType::kVerticalText: return ECORE_X_CURSOR_XTERM; - case WebCursorInfo::kTypeCell: + case ui::mojom::CursorType::kCell: return ECORE_X_CURSOR_XTERM; - case WebCursorInfo::kTypeContextMenu: + case ui::mojom::CursorType::kContextMenu: return ECORE_X_CURSOR_XTERM; - case WebCursorInfo::kTypeAlias: + case ui::mojom::CursorType::kAlias: return ECORE_X_CURSOR_XTERM; - case WebCursorInfo::kTypeProgress: + case ui::mojom::CursorType::kProgress: return ECORE_X_CURSOR_WATCH; - case WebCursorInfo::kTypeNoDrop: + case ui::mojom::CursorType::kNoDrop: return ECORE_X_CURSOR_XTERM; - case WebCursorInfo::kTypeCopy: + case ui::mojom::CursorType::kCopy: return ECORE_X_CURSOR_XTERM; - case WebCursorInfo::kTypeNone: + case ui::mojom::CursorType::kNone: return ECORE_X_CURSOR_XTERM; - case WebCursorInfo::kTypeNotAllowed: + case ui::mojom::CursorType::kNotAllowed: return ECORE_X_CURSOR_XTERM; - case WebCursorInfo::kTypeZoomIn: - case WebCursorInfo::kTypeZoomOut: - case WebCursorInfo::kTypeGrab: - case WebCursorInfo::kTypeGrabbing: - case WebCursorInfo::kTypeCustom: + case ui::mojom::CursorType::kZoomIn: + case ui::mojom::CursorType::kZoomOut: + case ui::mojom::CursorType::kGrab: + case ui::mojom::CursorType::kGrabbing: + case ui::mojom::CursorType::kCustom: return ECORE_X_CURSOR_XTERM; // Need to check the ECORE_X_CURSOR_XTERM } NOTREACHED(); return ECORE_X_CURSOR_XTERM; -#endif // EWK_BRINGUP } #endif // defined(USE_WAYLAND) diff --git a/tizen_src/chromium_impl/content/common/cursors/webcursor_efl.h b/tizen_src/chromium_impl/content/common/cursors/webcursor_efl.h index c6a5ea1..00784d8 100644 --- a/tizen_src/chromium_impl/content/common/cursors/webcursor_efl.h +++ b/tizen_src/chromium_impl/content/common/cursors/webcursor_efl.h @@ -5,10 +5,12 @@ #ifndef WEBCURSOR_EFL_H #define WEBCURSOR_EFL_H +#include "ui/base/cursor/mojom/cursor_type.mojom-shared.h" + #if defined(USE_WAYLAND) -const char* GetCursorName(int type); +const char* GetCursorName(ui::mojom::CursorType type); #else -int GetCursorType(int type); +int GetCursorType(ui::mojom::CursorType type); #endif #endif