commit 75963b232667b53487cab95360fcda2e6bd183ba
parent 89f3fbc028eaafc94b41de2d10e680e91c9f0cbf
Author: Kyle Milz <kmilz@ucalgary.ca>
Date: Tue, 9 Oct 2012 21:17:57 -0600
make a kind-of-nice process crashed page
Diffstat:
1 file changed, 31 insertions(+), 0 deletions(-)
diff --git a/src/callbacks.c b/src/callbacks.c
@@ -934,6 +934,36 @@ _win_del_request_cb(void *data, Evas_Object *obj, void *event_info)
free(wd);
}
+static void
+webprocess_crashed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ Window_Data *wd = data;
+ Eina_Bool *handled = event_info;
+
+ const char html[] = "\
+<html>\
+ <head>\
+ <style type=\"text/css\">\
+ body {\
+ background-color: #660000;\
+ color: white;\
+ font-family: monospace;\
+ position: absolute;\
+ top: 50%;\
+ }\
+ </style>\
+ </head>\
+ <body>\
+ <h1>\
+ Uh oh webkit crashed!\
+ </h1>\
+ </body>\
+</html>";
+
+ ewk_view_html_string_load(wd->cur_buf->view, html, NULL, ewk_view_url_get(wd->cur_buf->view));
+ *handled = EINA_TRUE;
+}
+
/*
static void
webview_create_window_cb(void *data, Evas_Object *obj, Eina_Bool js, const Elm_Web_Window_Features *wf)
@@ -953,6 +983,7 @@ setup_buffer_callbacks(Buffer_Data *td)
// elm_web_window_create_hook_set(td->web, webview_create_window_cb, td->window);
// elm_web_console_message_hook_set(td->web, webview_console_cb, td);
+ evas_object_smart_callback_add(v, "webprocess,crashed", webprocess_crashed_cb, wd);
/* downloads */
evas_object_smart_callback_add(v, "download,request", download_request_cb, wd);