This patch sets scroll offset via mojo connection instead of legacy ipc.
Reference: https://review.tizen.org/gerrit/282703/
Change-Id: Ib2607477ab3b4bcc4f2b8524349803ada5661f76
Signed-off-by: Ayush Kumar <ayush.k123@samsung.com>
#if BUILDFLAG(IS_EFL)
void TestPageBroadcast::ScrollFocusedNodeIntoView() {}
+
+void TestPageBroadcast::SetScrollOffset(float x, float y) {}
#endif
void TestPageBroadcast::SetPageBaseBackgroundColor(
int32_t history_length) override;
#if BUILDFLAG(IS_EFL)
void ScrollFocusedNodeIntoView() override;
+ void SetScrollOffset(float x, float y) override;
#endif
void SetPageBaseBackgroundColor(absl::optional<SkColor> color) override;
void CreateRemoteMainFrame(
[EnableIf=is_efl]
ScrollFocusedNodeIntoView();
+ [EnableIf=is_efl]
+ SetScrollOffset(float x, float y);
+
// Sent to whole page, but should only be used by the main frame.
SetPageBaseBackgroundColor(skia.mojom.SkColor? color);
return handled;
}
+
+void WebViewImpl::SetScrollOffset(float x, float y) {
+ if (auto* focused_frame = FocusedFrame())
+ focused_frame->SetScrollOffset(gfx::PointF(x, y));
+}
#endif
#if defined(TIZEN_VIDEO_HOLE)
bool HasAcceleratedCanvasWithinViewport() const override;
void SetLongPollingGlobalTimeout(uint64_t timeout) override;
void ScrollFocusedNodeIntoView() override;
+ void SetScrollOffset(float x, float y) override;
#endif
// Functions to add and remove observers for this object.
}
void EWebView::SetScroll(int x, int y) {
- RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
- if (!render_view_host)
- return;
-
- ChangeScroll(x, y);
-#if !defined(EWK_BRINGUP) // FIXME: m94 bringup
- render_view_host->Send(
- new EwkViewMsg_SetScroll(render_view_host->GetRoutingID(), x, y));
-#endif
+ if (auto* render_view_host = web_contents_->GetRenderViewHost()) {
+ if (auto& broadcast = static_cast<RenderViewHostImpl*>(render_view_host)
+ ->GetAssociatedPageBroadcast()) {
+ ChangeScroll(x, y);
+ broadcast->SetScrollOffset(x, y);
+ }
+ }
}
void EWebView::UseSettingsFont() {