This patch is needed to support ewk_context_favicon_database_get.
This is code migration from m34 beta to DEV,
Original patch info: http://suprem.sec.samsung.net/gerrit/#/c/6865/
Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=7636
Reviewed by: Antonio Gomes, SeungSeop Park
Change-Id: Ida3a261efa38ea4b636eb1abe65da64f107fc244
Signed-off-by: zhishun.zhou <zhishun.zhou@samsung.com>
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#if defined(OS_TIZEN_TV) && !defined(EWK_BRINGUP)
+#if defined(OS_TIZEN_TV)
#ifndef ewk_favicon_database_private_h
#define ewk_favicon_database_private_h
struct EwkFaviconDatabase {
public:
+ static EwkFaviconDatabase *Instance()
+ {
+ static EwkFaviconDatabase database;
+ return &database;
+ }
+
EwkFaviconDatabase()
:favicon_database(NULL)
{
Ewk_Favicon_Database* ewk_context_favicon_database_get(const Ewk_Context* ewkContext)
{
-#if defined(OS_TIZEN_TV) && !defined(EWK_BRINGUP)
+#if defined(OS_TIZEN_TV)
EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
- Ewk_Favicon_Database favicon_database;
- favicon_database.InitEwkFaviconDatabase(ewkContext);
- return (&favicon_database);
+ Ewk_Favicon_Database *favicon_database = Ewk_Favicon_Database::Instance();
+ favicon_database->InitEwkFaviconDatabase(ewkContext);
+ return favicon_database;
#else
LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
return NULL;
CHECK_OPEN;
m_database->Clear();
}
+
+#if defined(OS_TIZEN_TV)
+FaviconDatabase* FaviconService::GetFaviconDatabase() {
+ return FaviconDatabase::Instance();
+}
+#endif
bool ExistsForPageURL(const GURL &pageUrl) const;
bool ExistsForFaviconURL(const GURL &iconUrl) const;
void Clear();
+#if defined(OS_TIZEN_TV)
+ static FaviconDatabase* GetFaviconDatabase();
+#endif
private:
FaviconDatabase *m_database;
return fs.SetDatabasePath(path);
}
+#if defined(OS_TIZEN_TV)
+FaviconDatabase* EWebContext::GetFaviconDatabase() {
+ return FaviconService::GetFaviconDatabase();
+}
+#endif
+
Evas_Object *EWebContext::AddFaviconObject(const char* uri, Evas* canvas) const {
if (uri == NULL || canvas == NULL) {
return NULL;
typedef std::map<std::string, std::string> HTTPCustomHeadersEflMap;
class CookieManager;
+#if defined(OS_TIZEN_TV)
+class FaviconDatabase;
+#endif
namespace content {
class BrowserContextEfl;
void ClearCandidateData();
void ClearPasswordData();
void Initialize(Evas_Object* object);
+#if defined(OS_TIZEN_TV)
+ FaviconDatabase* GetFaviconDatabase();
+#endif
private:
EWebContext();
return impl->SetFaviconDatabasePath(path);
}
+#if defined(OS_TIZEN_TV)
+FaviconDatabase* WebContext::GetFaviconDatabase() {
+ return impl->GetFaviconDatabase();
+}
+#endif
+
Evas_Object * WebContext::AddFaviconObject(const char *uri, Evas *canvas) const {
return impl->AddFaviconObject(uri, canvas);
}
class CookieManager;
class Ewk_Cookie_Manager;
class EWebContext;
+#if defined(OS_TIZEN_TV)
+class FaviconDatabase;
+#endif
//struct Ewk_IPC_Wrt_Message_Data;
namespace content {
// Note: Do not use outside chromium
EWebContext* GetImpl() { return impl; }
+#if defined(OS_TIZEN_TV)
+ FaviconDatabase* GetFaviconDatabase();
+#endif
private:
EWebContext* impl;