From b4ef0797e5b7229edc82ed23285cf47197a2c237 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 30 Oct 2017 15:32:04 -0400 Subject: MqWebViewScheme: Add ready_cb member And call it from mq_web_view_*_scheme_methods.initialize(). --- (limited to 'src') diff --git a/src/web-view-schemes/normal.c b/src/web-view-schemes/normal.c index 5641a9c..7cecdab 100644 --- a/src/web-view-schemes/normal.c +++ b/src/web-view-schemes/normal.c @@ -41,9 +41,10 @@ match_uri(const gchar *uri) } static void -initialize(MqWebView G_GNUC_UNUSED *web_view, - MqWebViewScheme G_GNUC_UNUSED *scheme, const gchar G_GNUC_UNUSED *uri) +initialize(MqWebView *web_view, MqWebViewScheme *scheme, + const gchar G_GNUC_UNUSED *uri) { + scheme->ready_cb(scheme, web_view); } static void diff --git a/src/web-view-schemes/schemes.h b/src/web-view-schemes/schemes.h index 7ed7a0b..3c27769 100644 --- a/src/web-view-schemes/schemes.h +++ b/src/web-view-schemes/schemes.h @@ -48,6 +48,7 @@ struct _MqWebViewScheme { MqWebViewNormalScheme normal; MqWebViewViewSourceScheme view_source; }; + void (*ready_cb)(MqWebViewScheme *, MqWebView *); }; typedef struct { diff --git a/src/web-view-schemes/view-source.c b/src/web-view-schemes/view-source.c index a654e5d..ab36f49 100644 --- a/src/web-view-schemes/view-source.c +++ b/src/web-view-schemes/view-source.c @@ -59,6 +59,8 @@ initialize(MqWebView *web_view, MqWebViewScheme *scheme, const gchar *uri) scheme->view_source.uri = mq_web_view_get_uri( mq_tab_page_get_web_view(origin_tab)); /* TODO: Get data. */ + + scheme->ready_cb(scheme, web_view); } static void -- cgit v0.9.1