Create string tightly when retrive string from cbhm callback event
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / API / efl / ewk_view_icondatabase_client.cpp
1 /*\r
2    Copyright (C) 2013 Samsung Electronics\r
3 \r
4     This library is free software; you can redistribute it and/or\r
5     modify it under the terms of the GNU Library General Public\r
6     License as published by the Free Software Foundation; either\r
7     version 2 of the License, or (at your option) any later version.\r
8 \r
9     This library is distributed in the hope that it will be useful,\r
10     but WITHOUT ANY WARRANTY; without even the implied warranty of\r
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
12     Library General Public License for more details.\r
13 \r
14     You should have received a copy of the GNU Library General Public License\r
15     along with this library; see the file COPYING.LIB.  If not, write to\r
16     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\r
17     Boston, MA 02110-1301, USA.\r
18 */\r
19 \r
20 #include "config.h"\r
21 #include "ewk_view_icondatabase_client.h"\r
22 \r
23 #if ENABLE(TIZEN_ICON_DATABASE)\r
24 #include "WKIconDatabase.h"\r
25 #include "ewk_view_private.h"\r
26 \r
27 static void didChangeIconForPageURLTizen(WKIconDatabaseRef iconDatabase, WKURLRef pageURL, const void* clientInfo)\r
28 {\r
29     Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));\r
30     ewkViewIconReceived(ewkView);\r
31 }\r
32 \r
33 void ewk_view_icondatabase_client_attach(Evas_Object* ewkView, WKContextRef contextRef)\r
34 {\r
35     WKIconDatabaseClient iconDataBaseClient;\r
36     memset(&iconDataBaseClient, 0, sizeof(WKIconDatabaseClient));\r
37     iconDataBaseClient.version = kWKIconDatabaseClientCurrentVersion;\r
38     iconDataBaseClient.clientInfo = ewkView;\r
39 \r
40     iconDataBaseClient.didChangeIconForPageURL = didChangeIconForPageURLTizen;\r
41 \r
42     WKIconDatabaseRef iconDataBase = WKContextGetIconDatabase(contextRef);\r
43     WKIconDatabaseSetIconDatabaseClient(iconDataBase, &iconDataBaseClient);\r
44 }\r
45 #endif\r