Changeset 94965 in webkit
- Timestamp:
- Sep 12, 2011 10:54:33 AM (13 years ago)
- Location:
- trunk/Source/WebKit/efl
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/efl/CMakeListsEfl.txt
r94509 r94965 74 74 efl/ewk/ewk_network.cpp 75 75 efl/ewk/ewk_settings.cpp 76 efl/ewk/ewk_protocol_handler.cpp 76 77 efl/ewk/ewk_tiled_backing_store.c 77 78 efl/ewk/ewk_tiled_matrix.c … … 116 117 efl/ewk/ewk_auth.cpp 117 118 efl/ewk/ewk_auth_soup.cpp 119 efl/ewk/ewk_protocol_handler_soup.cpp 118 120 ) 119 121 ENDIF () … … 236 238 ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_main.h 237 239 ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_network.h 240 ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_protocol_handler.h 238 241 ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_settings.h 239 242 ${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_view.h -
trunk/Source/WebKit/efl/ChangeLog
r94509 r94965 1 2011-09-12 Flavio Ceolin <flavio.ceolin@profusion.mobi> 2 3 Reviewed by Martin Robinson. 4 5 [EFL] Add custom network resource handler 6 https://bugs.webkit.org/show_bug.cgi?id=44759 7 8 This patch adds support for handling user-specific protocols. 9 It allows browsers to intercept and handle non-standard url schemes (such as preferences://) 10 allowing to load some resource from non-http/file storage, like a tar/zip/eet. 11 12 * CMakeListsEfl.txt: 13 * ewk/ewk_protocol_handler.cpp: Added. 14 * ewk/ewk_protocol_handler.h: Added. 15 * ewk/ewk_protocol_handler_soup.cpp: Added. 16 * ewk/ewk_protocol_handler_soup.h: Added. 17 * ewk/ewk_private.h: 18 * ewk/ewk_view.cpp: 19 (ewk_view_protocol_handler_set): 20 (ewk_view_protocol_handler_unset): 21 (ewk_view_protocol_handler_resource_get): 22 * ewk/ewk_view.h: 23 1 24 2011-09-04 Ryuan Choi <ryuan.choi@samsung.com> 2 25 -
trunk/Source/WebKit/efl/ewk/ewk_private.h
r94063 r94965 135 135 136 136 void ewk_view_download_request(Evas_Object *o, Ewk_Download *download); 137 void *ewk_view_protocol_handler_resource_get(Evas_Object *o, size_t *bytesRead, char **mime, const char *file); 137 138 138 139 void ewk_view_editor_client_contents_changed(Evas_Object *o); -
trunk/Source/WebKit/efl/ewk/ewk_view.cpp
r94414 r94965 51 51 #include "c_instance.h" 52 52 #include "ewk_private.h" 53 #include "ewk_protocol_handler.h" 53 54 54 55 #include <Ecore.h> … … 93 94 WebCore::ViewportArguments viewport_arguments; 94 95 Ewk_History *history; 96 struct { 97 void* context; 98 Ewk_View_Resource_Handler_Cb function; 99 } custom_resource_handler; 95 100 struct { 96 101 Ewk_Menu menu; … … 3597 3602 } 3598 3603 3604 Eina_Bool ewk_view_protocol_handler_set(Evas_Object* o, const char** protocols, Ewk_View_Resource_Handler_Cb handler, void* context) 3605 { 3606 EWK_VIEW_SD_GET(o, sd); 3607 EWK_VIEW_PRIV_GET(sd, priv); 3608 3609 if (!handler) 3610 return EINA_FALSE; 3611 3612 priv->custom_resource_handler.function = handler; 3613 priv->custom_resource_handler.context = context; 3614 3615 return ewk_custom_protocol_handler_set(protocols); 3616 } 3617 3618 Eina_Bool ewk_view_protocol_handler_unset(Evas_Object* o) 3619 { 3620 EWK_VIEW_SD_GET(o, sd); 3621 EWK_VIEW_PRIV_GET(sd, priv); 3622 Eina_Bool ret = ewk_custom_protocol_handler_all_unset(); 3623 3624 if (ret) { 3625 priv->custom_resource_handler.function = 0; 3626 priv->custom_resource_handler.context = 0; 3627 } 3628 3629 return ret; 3630 } 3631 3632 void* ewk_view_protocol_handler_resource_get(Evas_Object* o, size_t* bytesRead, char** mime, const char* file) 3633 { 3634 EWK_VIEW_SD_GET(o, sd); 3635 EWK_VIEW_PRIV_GET(sd, priv); 3636 3637 Ewk_View_Resource_Handler_Cb function = priv->custom_resource_handler.function; 3638 if (function) 3639 return function(file, bytesRead, mime, priv->custom_resource_handler.context); 3640 3641 return 0; 3642 } 3599 3643 3600 3644 /** -
trunk/Source/WebKit/efl/ewk/ewk_view.h
r94380 r94965 100 100 typedef struct _Ewk_View_Smart_Data Ewk_View_Smart_Data; 101 101 102 /// Creates a type name for a Resource Handler Callback 103 typedef void* (*Ewk_View_Resource_Handler_Cb)(const char *, size_t *, char **, void *); 104 102 105 /// Creates a type name for @a _Ewk_View_Smart_Class. 103 106 typedef struct _Ewk_View_Smart_Class Ewk_View_Smart_Class; … … 2145 2148 */ 2146 2149 EAPI Eina_Bool ewk_view_js_object_add(Evas_Object *o, Ewk_JS_Object *obj, const char *obj_name); 2150 2151 /** 2152 * Register a new protocol handler for handling an specific protocol (scheme). 2153 * 2154 * @param o view. 2155 * @param protocols the protocols that will be handled. 2156 * @param handler the function that will be executed for the protocols 2157 * @param ctxt the handler context 2158 * @return @c EINA_TRUE if success, @c EINA_FALSE if not. 2159 */ 2160 EAPI Eina_Bool ewk_view_protocol_handler_set(Evas_Object* o, const char** protocol, Ewk_View_Resource_Handler_Cb handler, void* ctxt); 2161 2162 /** 2163 * Remove the custom protocol handler. 2164 * 2165 * @param o view. 2166 * @return @c EINA_TRUE if success, @c EINA_FALSE if not. 2167 */ 2168 EAPI Eina_Bool ewk_view_protocol_handler_unset(Evas_Object* o); 2169 2147 2170 #ifdef __cplusplus 2148 2171 }
Note: See TracChangeset
for help on using the changeset viewer.