From cf9a4709041c532c12f90e67892455fe7eeb80e4 Mon Sep 17 00:00:00 2001 From: jiangyuwei Date: Mon, 22 Apr 2024 13:50:31 +0800 Subject: [PATCH] [M120 Migration] Implemention of ewk_context_icon_database_delete_all for favicon DB Implement ewk_context_icon_database_delete_all api to clear favicon DB. Reference: - https://review.tizen.org/gerrit/304025/ Change-Id: Ief75a66eb835350ac9b03f7807ce88a2e2b32047 Signed-off-by: jiangyuwei --- tizen_src/ewk/efl_integration/eweb_context.cc | 4 ++++ tizen_src/ewk/efl_integration/eweb_context.h | 1 + tizen_src/ewk/efl_integration/private/ewk_context_private.cc | 4 ++++ tizen_src/ewk/efl_integration/private/ewk_context_private.h | 1 + tizen_src/ewk/efl_integration/public/ewk_context.cc | 3 ++- 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tizen_src/ewk/efl_integration/eweb_context.cc b/tizen_src/ewk/efl_integration/eweb_context.cc index dbe2d10f5f07..48c3eeb7b4fc 100644 --- a/tizen_src/ewk/efl_integration/eweb_context.cc +++ b/tizen_src/ewk/efl_integration/eweb_context.cc @@ -820,6 +820,10 @@ bool EWebContext::SetFaviconDatabasePath(const base::FilePath& path) { return FaviconDatabase::Instance()->SetPath(path); } +void EWebContext::ClearFaviconDatabase() { + FaviconDatabase::Instance()->Clear(); +} + Evas_Object* EWebContext::AddFaviconObject(const char* uri, Evas* canvas) const { if (uri == NULL || canvas == NULL) { diff --git a/tizen_src/ewk/efl_integration/eweb_context.h b/tizen_src/ewk/efl_integration/eweb_context.h index aadfd54119f8..545e5a77be88 100644 --- a/tizen_src/ewk/efl_integration/eweb_context.h +++ b/tizen_src/ewk/efl_integration/eweb_context.h @@ -152,6 +152,7 @@ class EWebContext { Ewk_Local_File_System_Origins_Get_Callback callback, void* user_data) const; bool SetFaviconDatabasePath(const base::FilePath& path); + void ClearFaviconDatabase(); Evas_Object *AddFaviconObject(const char *uri, Evas *canvas) const; void SetTizenAppId(const std::string& tizen_app_id); diff --git a/tizen_src/ewk/efl_integration/private/ewk_context_private.cc b/tizen_src/ewk/efl_integration/private/ewk_context_private.cc index facb920ade79..8782b1d4f21f 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_context_private.cc +++ b/tizen_src/ewk/efl_integration/private/ewk_context_private.cc @@ -256,6 +256,10 @@ bool Ewk_Context::SetFaviconDatabasePath(const base::FilePath& path) { return impl->SetFaviconDatabasePath(path); } +void Ewk_Context::ClearFaviconDatabase() { + impl->ClearFaviconDatabase(); +} + EwkFaviconDatabase* Ewk_Context::GetFaviconDatabase() const { return impl->GetFaviconDatabase(); } diff --git a/tizen_src/ewk/efl_integration/private/ewk_context_private.h b/tizen_src/ewk/efl_integration/private/ewk_context_private.h index 33ac56af4d19..2b84c1be9ecc 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_context_private.h +++ b/tizen_src/ewk/efl_integration/private/ewk_context_private.h @@ -109,6 +109,7 @@ struct Ewk_Context : public base::RefCounted { // Favicon bool SetFaviconDatabasePath(const base::FilePath& path); + void ClearFaviconDatabase(); Evas_Object *AddFaviconObject(const char *uri, Evas *canvas) const; // Widget diff --git a/tizen_src/ewk/efl_integration/public/ewk_context.cc b/tizen_src/ewk/efl_integration/public/ewk_context.cc index 29209d2fad84..5630d60da9b8 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_context.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_context.cc @@ -896,7 +896,8 @@ void ewk_context_password_confirm_popup_reply(Ewk_Context* context, Ewk_Context_ void ewk_context_icon_database_delete_all(Ewk_Context* context) { - LOG_EWK_API_MOCKUP(); + EINA_SAFETY_ON_NULL_RETURN(context); + context->ClearFaviconDatabase(); } Eina_Bool ewk_context_check_accessible_path_callback_set(Ewk_Context* context, Ewk_Context_Check_Accessible_Path_Callback callback, void* user_data) -- 2.34.1