Implement ewk_favicon_database_icon_get()
authorMarcin Niesluchowski <m.niesluchow@samsung.com>
Mon, 17 Aug 2015 11:48:41 +0000 (13:48 +0200)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 07:55:23 +0000 (07:55 +0000)
Implement ewk_favicon_database_icon_get() by calling
EwkFaviconDatabase::GetIcon() (also added by this patch).
EwkFaviconDatabase holds an instance of EWebContext, needed
in the call chain.

Original beta/m42_2311_t patch:
- http://165.213.202.130/gerrit/#/c/85278/

Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=14809

Reviewed by: d.waslicki, g.czajkowski, msu.koo

Change-Id: I64ee94547570758a45d9d4aa6c0c8556c8c8f258
Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
tizen_src/ewk/efl_integration/private/ewk_favicon_database_private.h
tizen_src/ewk/efl_integration/public/ewk_favicon_database.cc

index 585bfec7dd08f252038ffd640fa27af4f39f6e2e..7f09014019f5a52be69add0d5cf221f2056fce44 100644 (file)
@@ -5,6 +5,8 @@
 #ifndef ewk_favicon_database_private_h
 #define ewk_favicon_database_private_h
 
+#include "eweb_context.h"
+
 class EWebContext;
 
 class EwkFaviconDatabase {
@@ -12,6 +14,10 @@ class EwkFaviconDatabase {
   explicit EwkFaviconDatabase(EWebContext* eweb_context)
     : eweb_context_(eweb_context) {}
 
+  Evas_Object* GetIcon(const char* page_url, Evas* evas) const {
+    return eweb_context_->AddFaviconObject(page_url, evas);
+  }
+
  private:
   EWebContext* eweb_context_;
 };
index aa693e6170ae6ba4c5234488b39ac796857929c9..d1afecaa7f3ddda5bb6a3dcc6289f7185bce313a 100644 (file)
@@ -4,12 +4,17 @@
 // found in the LICENSE file.
 
 #include "ewk_favicon_database.h"
+
+#include "private/ewk_favicon_database_private.h"
 #include "private/ewk_private.h"
 
 Evas_Object* ewk_favicon_database_icon_get(Ewk_Favicon_Database* ewkIconDatabase, const char* pageURL, Evas* evas)
 {
-  LOG_EWK_API_MOCKUP("for Tizen TV Browser");
-  return NULL;
+  EINA_SAFETY_ON_NULL_RETURN_VAL(ewkIconDatabase, nullptr);
+  EINA_SAFETY_ON_NULL_RETURN_VAL(pageURL, nullptr);
+  EINA_SAFETY_ON_NULL_RETURN_VAL(evas, nullptr);
+
+  return ewkIconDatabase->GetIcon(pageURL, evas);
 }
 
 void ewk_favicon_database_icon_change_callback_add(Ewk_Favicon_Database* ewkIconDatabase, Ewk_Favicon_Database_Icon_Change_Cb callback, void* userData)