// run them here after we clear it.
SendScreenRects();
SynchronizeVisualProperties();
+#if BUILDFLAG(IS_TIZEN_TV)
+ if (pending_suspend_network_loading_closure_)
+ std::move(pending_suspend_network_loading_closure_).Run();
+
+ if (pending_resume_network_loading_closure_)
+ std::move(pending_resume_network_loading_closure_).Run();
+
+ if (pending_set_active_closure_)
+ std::move(pending_set_active_closure_).Run();
+
+ if (pending_set_page_focus_closure_)
+ std::move(pending_set_page_focus_closure_).Run();
+#endif
+
// Show/Hide state is not given to the renderer while we are
// `waiting_for_init_`, but Init() signals that the renderer is ready to
// receive them. This call will inform the renderer that the widget is shown.
DCHECK(!pending_show_params_);
if (!waiting_for_init_) {
+ if (!blink_widget_) {
+ LOG(ERROR) << "Bind WidgetInterfaces still not finish";
+ return;
+ }
blink_widget_->WasShown(view_->is_evicted(),
std::move(record_tab_switch_time_request));
} else {
void RenderWidgetHostImpl::SetFloatVideoWindowState(bool enabled) {
blink_widget_->SetFloatVideoWindowState(enabled);
}
-#endif
-#endif
+
+void RenderWidgetHostImpl::SuspendNetworkLoading() {
+ if (!waiting_for_init_) {
+ if (!blink_widget_) {
+ LOG(ERROR) << "Bind WidgetInterfaces still not finish";
+ return;
+ }
+ blink_widget_->SuspendNetworkLoading();
+
+ if (pending_suspend_network_loading_closure_)
+ pending_suspend_network_loading_closure_.Reset();
+ } else {
+ LOG(INFO) << "set pending SuspendNetworkLoading";
+ pending_suspend_network_loading_closure_ =
+ base::BindOnce(&RenderWidgetHostImpl::RunPendingSuspendNetworkLoading,
+ base::Unretained(this));
+ }
+}
+
+void RenderWidgetHostImpl::RunPendingSuspendNetworkLoading() {
+ if (!blink_widget_) {
+ LOG(ERROR) << "Bind WidgetInterfaces still not finish";
+ return;
+ }
+ blink_widget_->SuspendNetworkLoading();
+}
+
+void RenderWidgetHostImpl::ResumeNetworkLoading() {
+ if (!waiting_for_init_) {
+ if (!blink_widget_) {
+ LOG(ERROR) << "Bind WidgetInterfaces still not finish";
+ return;
+ }
+ blink_widget_->ResumeNetworkLoading();
+
+ if (pending_resume_network_loading_closure_)
+ pending_resume_network_loading_closure_.Reset();
+ } else {
+ LOG(INFO) << "set pending ResumeNetworkLoading";
+ pending_resume_network_loading_closure_ =
+ base::BindOnce(&RenderWidgetHostImpl::RunPendingResumeNetworkLoading,
+ base::Unretained(this));
+ }
+}
+
+void RenderWidgetHostImpl::RunPendingResumeNetworkLoading() {
+ if (!blink_widget_) {
+ LOG(ERROR) << "Bind WidgetInterfaces still not finish";
+ return;
+ }
+ blink_widget_->ResumeNetworkLoading();
+}
+#endif // IS_TIZEN_TV
+#endif // IS_EFL
blink::VisualProperties RenderWidgetHostImpl::GetInitialVisualProperties() {
blink::VisualProperties initial_props = GetVisualProperties();
}
}
+void RenderWidgetHostImpl::SetFocusInternal(bool focused) {
+ blink::mojom::FocusState focus_state =
+ blink::mojom::FocusState::kNotFocusedAndNotActive;
+ if (focused)
+ focus_state = blink::mojom::FocusState::kFocused;
+ else if (is_active_)
+ focus_state = blink::mojom::FocusState::kNotFocusedAndActive;
+
+ GetWidgetInputHandler()->SetFocus(focus_state);
+}
+
void RenderWidgetHostImpl::SetPageFocus(bool focused) {
OPTIONAL_TRACE_EVENT1("content", "RenderWidgetHostImpl::SetPageFocus",
"is_focused", focused);
LockKeyboard();
}
- blink::mojom::FocusState focus_state =
- blink::mojom::FocusState::kNotFocusedAndNotActive;
- if (focused) {
- focus_state = blink::mojom::FocusState::kFocused;
- } else if (is_active_) {
- focus_state = blink::mojom::FocusState::kNotFocusedAndActive;
- }
+#if BUILDFLAG(IS_TIZEN_TV)
+ if (!waiting_for_init_) {
+ SetFocusInternal(focused);
- GetWidgetInputHandler()->SetFocus(focus_state);
+ if (pending_set_page_focus_closure_)
+ pending_set_page_focus_closure_.Reset();
+
+ } else {
+ LOG(INFO) << "set Pending SetPageFocus";
+ pending_set_page_focus_closure_ =
+ base::BindOnce(&RenderWidgetHostImpl::RunPendingSetPageFocus,
+ base::Unretained(this), focused);
+ }
+#else
+ SetFocusInternal(focused);
+#endif
// Also send page-level focus state to other SiteInstances involved in
// rendering the current FrameTree, if this widget is for a main frame.
}
}
+#if BUILDFLAG(IS_TIZEN_TV)
+void RenderWidgetHostImpl::RunPendingSetPageFocus(bool focused) {
+ SetFocusInternal(focused);
+}
+#endif
+
void RenderWidgetHostImpl::LostCapture() {
if (auto* touch_emulator = GetExistingTouchEmulator()) {
touch_emulator->CancelTouch();
GetWidgetInputHandler()->MouseCaptureLost();
}
+#if BUILDFLAG(IS_TIZEN_TV)
+void RenderWidgetHostImpl::RunPendingSetActive(bool active) {
+ SetActiveInternal(active);
+}
+#endif
+
void RenderWidgetHostImpl::SetActive(bool active) {
+#if BUILDFLAG(IS_TIZEN_TV)
+ if (!waiting_for_init_) {
+ SetActiveInternal(active);
+
+ if (pending_set_active_closure_)
+ pending_set_active_closure_.Reset();
+ } else {
+ LOG(INFO) << "set pending setActive";
+ pending_set_active_closure_ =
+ base::BindOnce(&RenderWidgetHostImpl::RunPendingSetActive,
+ base::Unretained(this), active);
+ }
+#else
+ SetActiveInternal(active);
+#endif
+}
+
+void RenderWidgetHostImpl::SetActiveInternal(bool active) {
is_active_ = active;
if (blink_frame_widget_) {
blink_frame_widget_->SetActive(active);
void ResetLastInteractedElements();
#if BUILDFLAG(IS_TIZEN_TV)
void SetFloatVideoWindowState(bool enabled);
-#endif
-#endif
+ void SuspendNetworkLoading();
+ void ResumeNetworkLoading();
+#endif // IS_TIZEN_TV
+#endif // IS_EFL
#if BUILDFLAG(IS_TIZEN)
void PauseScheduledTasks();
// update. Users other than WebContents and RenderWidgetHost should use
// Focus()/Blur().
void SetPageFocus(bool focused);
+ void SetFocusInternal(bool focused);
+ void SetActiveInternal(bool active);
// Returns true if the RenderWidgetHost thinks it is active. This
// is different than `is_focused` but must always be true if `is_focused`
void AddPendingUserActivation(const blink::WebInputEvent& event);
void ClearPendingUserActivation();
+#if BUILDFLAG(IS_TIZEN_TV)
+ // Calls the pending blink::mojom::Widget::SuspendNetworkLoading.
+ void RunPendingSuspendNetworkLoading();
+
+ // Calls the pending blink::mojom::Widget::ResumeNetworkLoading.
+ void RunPendingResumeNetworkLoading();
+
+ // Calls the pending blink::mojom::FrameWidget::setActive.
+ void RunPendingSetActive(bool active);
+
+ // Calls the pending blink::mojom::WidgetInputHandler::SetPageFocus.
+ void RunPendingSetPageFocus(bool focused);
+#endif
+
// Dispatch any buffered FrameSink requests from the renderer if the widget
// has a view and is the owner for the FrameSinkId assigned to it.
void MaybeDispatchBufferedFrameSinkRequest();
InputRouterImpl::RequestMouseLockCallback request_mouse_callback_;
+#if BUILDFLAG(IS_TIZEN_TV)
+ base::OnceClosure pending_suspend_network_loading_closure_;
+ base::OnceClosure pending_resume_network_loading_closure_;
+ base::OnceClosure pending_set_active_closure_;
+ base::OnceClosure pending_set_page_focus_closure_;
+#endif
+
// Parameters to pass to blink::mojom::Widget::WasShown after
// `waiting_for_init_` becomes true. These are stored in a struct instead of
// storing a callback so that they can be updated if
[EnableIf=is_tizen_tv]
SetFloatVideoWindowState(bool enabled);
+ [EnableIf=is_tizen_tv]
+ SuspendNetworkLoading();
+
+ [EnableIf=is_tizen_tv]
+ ResumeNetworkLoading();
+
// Informs the widget that it was hidden. This allows it to reduce its
// resource utilization, and will cancel any pending
// RecordContentToVisibleTimeRequest that was set with WasShown or
// Returns the selection rect encompassing text and images.
virtual gfx::Rect CurrentSelectionRect() const = 0;
+
+#if BUILDFLAG(IS_TIZEN_TV)
+ // Suspends loaders for the main frame and all sub-frames.
+ virtual void SuspendNetworkLoading() = 0;
+
+ // Resumes perviously suspended frame loaders.
+ virtual void ResumeNetworkLoading() = 0;
+#endif // IS_TIZEN_TV
#endif
#if BUILDFLAG(IS_TIZEN_TV)
if (auto* focused_frame = FocusedFrame())
focused_frame->SetScrollOffset(gfx::PointF(x, y));
}
-#endif
+
+#if BUILDFLAG(IS_TIZEN_TV)
+void WebViewImpl::SuspendNetworkLoading() {
+ if (!GetPage())
+ return;
+
+ GetPage()->SetDefersLoading(true);
+}
+
+void WebViewImpl::ResumeNetworkLoading() {
+ if (!GetPage())
+ return;
+
+ GetPage()->SetDefersLoading(false);
+}
+#endif // IS_TIZEN_TV
+#endif // IS_EFL
#if defined(TIZEN_VIDEO_HOLE)
bool WebViewImpl::IsVideoHoleForRender() const {
void ScrollFocusedNodeIntoView() override;
void SetScrollOffset(float x, float y) override;
gfx::Rect CurrentSelectionRect() const override;
-#endif
+
+#if BUILDFLAG(IS_TIZEN_TV)
+ void SuspendNetworkLoading() override;
+ void ResumeNetworkLoading() override;
+#endif // IS_TIZEN_TV
+#endif // IS_EFL
// Functions to add and remove observers for this object.
void AddObserver(WebViewObserver* observer);
void WebFrameWidgetImpl::SetFloatVideoWindowState(bool enabled) {
View()->SetFloatVideoWindowState(enabled);
}
-#endif
-#endif
+
+void WebFrameWidgetImpl::SuspendNetworkLoading() {
+ View()->SuspendNetworkLoading();
+}
+
+void WebFrameWidgetImpl::ResumeNetworkLoading() {
+ View()->ResumeNetworkLoading();
+}
+#endif // IS_TIZEN_TV
+#endif // IS_EFL
#if BUILDFLAG(IS_TIZEN)
void WebFrameWidgetImpl::SetMaxRefreshRate(uint32_t max_refresh_rate) {
gfx::Rect RequestSelectionRect() override;
#if BUILDFLAG(IS_TIZEN_TV)
void SetFloatVideoWindowState(bool enabled) override;
+ void SuspendNetworkLoading() override;
+ void ResumeNetworkLoading() override;
#endif
#endif
void Page::SetLongPollingGlobalTimeout(uint64_t timeout) {
long_polling_global_timeout_ = timeout;
}
+
+void Page::SetDefersLoading(bool defers) {
+ LOG(INFO) << "defers : " << defers
+ << " defers_loading_ : " << defers_loading_;
+ if (defers == defers_loading_)
+ return;
+
+ defers_loading_ = defers;
+ for (Frame* frame = MainFrame(); frame;
+ frame = frame->Tree().TraverseNext()) {
+ if (auto* local_frame = DynamicTo<LocalFrame>(frame)) {
+ local_frame->Loader().SetDefersLoading(defers ? LoaderFreezeMode::kStrict
+ : LoaderFreezeMode::kNone);
+ }
+ }
+}
#endif
const base::UnguessableToken& Page::BrowsingContextGroupToken() {
uint64_t GetLongPollingGlobalTimeout() {
return long_polling_global_timeout_;
}
+ void SetDefersLoading(bool defers);
#endif
void AddAutoplayFlags(int32_t flags);
WebScopedVirtualTimePauser history_navigation_virtual_time_pauser_;
#if BUILDFLAG(IS_EFL)
uint64_t long_polling_global_timeout_ = 0;
+ bool defers_loading_ = false;
#endif // IS_EFL
Member<v8_compile_hints::V8CrowdsourcedCompileHintsProducer>
void WidgetBase::RequestSelectionRect(RequestSelectionRectCallback callback) {
std::move(callback).Run(client_->RequestSelectionRect());
}
-#endif
+
+#if BUILDFLAG(IS_TIZEN_TV)
+void WidgetBase::SuspendNetworkLoading() {
+ client_->SuspendNetworkLoading();
+}
+
+void WidgetBase::ResumeNetworkLoading() {
+ client_->ResumeNetworkLoading();
+}
+#endif // IS_TIZEN_TV
+#endif // IS_EFL
#if BUILDFLAG(IS_TIZEN_TV)
void WidgetBase::SetFloatVideoWindowState(bool enabled) {
RequestMainFrameScrollbarVisibleCallback callback) override;
#if BUILDFLAG(IS_TIZEN_TV)
void SetFloatVideoWindowState(bool enabled) override;
+ void SuspendNetworkLoading() override;
+ void ResumeNetworkLoading() override;
#endif // IS_TIZEN_TV
void QueryInputType(QueryInputTypeCallback) override;
void SelectClosestWord(uint32_t x, uint32_t y) override;
rwhi->SetFloatVideoWindowState(enabled);
}
+
+void EWebView::SuspendNetworkLoading() {
+ RenderWidgetHostImpl* rwhi = static_cast<RenderWidgetHostImpl*>(
+ web_contents_->GetRenderViewHost()->GetWidget());
+
+ rwhi->SuspendNetworkLoading();
+}
+
+void EWebView::ResumeNetworkLoading() {
+ RenderWidgetHostImpl* rwhi = static_cast<RenderWidgetHostImpl*>(
+ web_contents_->GetRenderViewHost()->GetWidget());
+
+ rwhi->ResumeNetworkLoading();
+}
#endif // IS_TIZEN_TV
double EWebView::GetTextZoomFactor() const {
return;
}
+#if BUILDFLAG(IS_TIZEN_TV)
+ if (pending_setfocus_closure_)
+ std::move(pending_setfocus_closure_).Run();
+#endif
+
for (auto iter = delayed_messages_.begin(); iter != delayed_messages_.end();
++iter) {
IPC::Message* message = *iter;
int player_id,
const char* url,
const char* mime_type);
+ void SuspendNetworkLoading();
+ void ResumeNetworkLoading();
#endif // IS_TIZEN_TV
void SetSessionTimeout(uint64_t timeout);
double GetTextZoomFactor() const;
#endif
}
-void ewk_view_resume_network_loading(Evas_Object* ewkView)
+void ewk_view_resume_network_loading(Evas_Object* ewk_view)
{
- LOG_EWK_API_MOCKUP();
+#if BUILDFLAG(IS_TIZEN_TV)
+ LOG(INFO) << "view : " << ewk_view;
+ EWK_VIEW_IMPL_GET_OR_RETURN(ewk_view, impl);
+ impl->ResumeNetworkLoading();
+#else
+ LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
+#endif
}
-void ewk_view_suspend_network_loading(Evas_Object* ewkView)
+void ewk_view_suspend_network_loading(Evas_Object* ewk_view)
{
- LOG_EWK_API_MOCKUP();
+#if BUILDFLAG(IS_TIZEN_TV)
+ LOG(INFO) << "view : " << ewk_view;
+ EWK_VIEW_IMPL_GET_OR_RETURN(ewk_view, impl);
+ impl->SuspendNetworkLoading();
+#else
+ LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
+#endif
}
void ewk_view_offscreen_rendering_enabled_set(Evas_Object* o, Eina_Bool enabled)
* @param item view object to resume new url loading
*
*/
-EXPORT_API void ewk_view_resume_network_loading(Evas_Object* ewkView);
+EXPORT_API void ewk_view_resume_network_loading(Evas_Object* ewk_view);
EXPORT_API void ewk_view_poweroff_suspend(Evas_Object *item);
* @param item view object to suspend url loading
*
*/
-EXPORT_API void ewk_view_suspend_network_loading(Evas_Object* ewkView);
+EXPORT_API void ewk_view_suspend_network_loading(Evas_Object* ewk_view);
/**
* This function should be use for browser edge scroll.