// properties, in case they have changed or this is the initial show.
UpdateScreenInfo();
+#if BUILDFLAG(IS_EFL)
+ if (offscreen_helper_)
+ offscreen_helper_->Show();
+#endif
+
// If the viz::LocalSurfaceId is invalid, we may have been evicted,
// and no other visual properties have since been changed. Allocate a new id
// and start synchronizing.
name);
}
+bool EWebView::SetPageVisibility(
+ Ewk_Page_Visibility_State page_visibility_state) {
+ if (!rwhva())
+ return false;
+
+ // TODO: We should able to set 'prerender' or 'unloaded' as visibility state.
+ // http://www.w3.org/TR/page-visibility/#dom-document-visibilitystate
+ switch (page_visibility_state) {
+ case EWK_PAGE_VISIBILITY_STATE_VISIBLE:
+ rwhva()->offscreen_helper()->SetPageVisibility(true);
+ break;
+ case EWK_PAGE_VISIBILITY_STATE_HIDDEN:
+ rwhva()->offscreen_helper()->SetPageVisibility(false);
+ break;
+ case EWK_PAGE_VISIBILITY_STATE_PRERENDER:
+ NOTIMPLEMENTED();
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+}
+
bool EWebView::CreateNewWindow(
content::WebContentsEflDelegate::WebContentsCreateCallback cb) {
create_new_window_web_contents_cb_ = cb;
}
exceeded_indexed_db_quota_origin_.reset();
}
+
+bool EWebView::SetVisibility(bool enable) {
+ if (!web_contents_)
+ return false;
+
+ if (enable)
+ web_contents_->WasShown();
+ else
+ web_contents_->WasHidden();
+
+ return true;
+}
\ No newline at end of file
const {
return gin_native_bridge_dispatcher_host_.get();
}
+ bool SetPageVisibility(Ewk_Page_Visibility_State page_visibility_state);
void SetExceededIndexedDatabaseQuotaCallback(
Ewk_View_Exceeded_Indexed_Database_Quota_Callback callback,
void OnOverscrolled(const gfx::Vector2dF& accumulated_overscroll,
const gfx::Vector2dF& latest_overscroll_delta);
+ bool SetVisibility(bool enable);
+
content::DateTimeChooserEfl* GetDateTimeChooser() {
return date_time_chooser_;
}
// isInitialState parameter seems be true only in the constructor of WebViewImpl.
EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
- // TODO: We should able to set 'prerender' or 'unloaded' as visibility state.
- // http://www.w3.org/TR/page-visibility/#dom-document-visibilitystate
- switch (page_visibility_state) {
- case EWK_PAGE_VISIBILITY_STATE_VISIBLE:
- impl->Show();
- break;
- case EWK_PAGE_VISIBILITY_STATE_HIDDEN:
- impl->Hide();
- break;
- default:
- return EINA_FALSE;
- }
- return EINA_TRUE;
+ return impl->SetPageVisibility(page_visibility_state);
}
Eina_Bool ewk_view_user_agent_set(Evas_Object* ewkView, const char* user_agent)
Eina_Bool ewk_view_visibility_set(Evas_Object* view, Eina_Bool enable)
{
EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
-
- if (enable)
- impl->Show();
- else
- impl->Hide();
-
- return EINA_TRUE;
+ return impl->SetVisibility(enable);
}
Evas_Object* ewk_view_screenshot_contents_get(const Evas_Object* view, Eina_Rectangle view_area, float scale_factor, Evas* canvas)