[M108 Migration] Implement ewk_view_favicon_get() API 93/288493/2
authorJie Zhang <jie137.zhang@samsung.com>
Fri, 17 Feb 2023 07:19:22 +0000 (15:19 +0800)
committerJie Zhang <jie137.zhang@samsung.com>
Mon, 20 Feb 2023 01:44:36 +0000 (01:44 +0000)
This API get the favorite-icon in current webview.

Reference:
 - https://review.tizen.org/gerrit/#/c/280190/

Change-Id: Ib293a7636214b39a4cdc111e8a16bd09d66677bd
Signed-off-by: Jie Zhang <jie137.zhang@samsung.com>
tizen_src/ewk/efl_integration/public/ewk_view.cc

index 6a6cb6d..aec5ec1 100644 (file)
@@ -1259,6 +1259,14 @@ Eina_Bool ewk_view_app_preload_set(Evas_Object* ewkView, Eina_Bool is_preload)
 }
 #endif
 
+Evas_Object* ewk_view_favicon_get(const Evas_Object* ewkView)
+{
+  EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, nullptr);
+  EINA_SAFETY_ON_NULL_RETURN_VAL(impl->context(), nullptr);
+  const char* url = ewk_view_url_get(ewkView);
+  return impl->context()->AddFaviconObject(url, impl->GetEvas());
+}
+
 Eina_Bool ewk_view_html_string_override_current_entry_load(Evas_Object* view, const char* html, const char* base_uri, const char* unreachable_url)
 {
   LOG_EWK_API_MOCKUP();