aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <diegoe@igalia.com>2012-12-11 00:24:45 +0800
committerDiego Escalante Urrelo <diegoe@igalia.com>2012-12-11 01:08:40 +0800
commite65754da16f9af433cd90279b60855705855253a (patch)
tree1e9229965f9a2ff0552e202e2df91bee59dba928 /embed
parent43587a75794e27225c71d485620f875b12338ac1 (diff)
downloadgsoc2013-epiphany-e65754da16f9af433cd90279b60855705855253a.tar
gsoc2013-epiphany-e65754da16f9af433cd90279b60855705855253a.tar.gz
gsoc2013-epiphany-e65754da16f9af433cd90279b60855705855253a.tar.bz2
gsoc2013-epiphany-e65754da16f9af433cd90279b60855705855253a.tar.lz
gsoc2013-epiphany-e65754da16f9af433cd90279b60855705855253a.tar.xz
gsoc2013-epiphany-e65754da16f9af433cd90279b60855705855253a.tar.zst
gsoc2013-epiphany-e65754da16f9af433cd90279b60855705855253a.zip
e-embed-shell: remove the embed_shell global
https://bugzilla.gnome.org/show_bug.cgi?id=683614
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-download.c10
-rw-r--r--embed/ephy-embed-shell.h2
-rw-r--r--embed/ephy-embed.c2
-rw-r--r--embed/ephy-web-view.c20
4 files changed, 17 insertions, 17 deletions
diff --git a/embed/ephy-download.c b/embed/ephy-download.c
index dc19b4589..792f5c1c7 100644
--- a/embed/ephy-download.c
+++ b/embed/ephy-download.c
@@ -715,7 +715,7 @@ ephy_download_dispose (GObject *object)
priv->widget = NULL;
}
- ephy_embed_shell_remove_download (embed_shell, download);
+ ephy_embed_shell_remove_download (ephy_embed_shell_get_default (), download);
G_OBJECT_CLASS (ephy_download_parent_class)->dispose (object);
}
@@ -955,7 +955,7 @@ download_finished_cb (WebKitDownload *wk_download,
else
ephy_download_do_download_action (download, priv->action);
- ephy_embed_shell_remove_download (embed_shell, download);
+ ephy_embed_shell_remove_download (ephy_embed_shell_get_default (), download);
}
#else
static void
@@ -980,11 +980,11 @@ download_status_changed_cb (GObject *object,
ephy_download_do_download_action (download, priv->action);
}
- ephy_embed_shell_remove_download (embed_shell, download);
+ ephy_embed_shell_remove_download (ephy_embed_shell_get_default (), download);
} else if (status == WEBKIT_DOWNLOAD_STATUS_CANCELLED ||
status == WEBKIT_DOWNLOAD_STATUS_ERROR) {
} else if (status == WEBKIT_DOWNLOAD_STATUS_STARTED) {
- ephy_embed_shell_add_download (embed_shell, download);
+ ephy_embed_shell_add_download (ephy_embed_shell_get_default (), download);
}
}
#endif
@@ -1090,7 +1090,7 @@ ephy_download_new_for_download (WebKitDownload *download)
#ifdef HAVE_WEBKIT2
/* In WebKit2 the download has already started */
- ephy_embed_shell_add_download (embed_shell, ephy_download);
+ ephy_embed_shell_add_download (ephy_embed_shell_get_default (), ephy_download);
#endif
return ephy_download;
diff --git a/embed/ephy-embed-shell.h b/embed/ephy-embed-shell.h
index 2daee5fe8..7432e1133 100644
--- a/embed/ephy-embed-shell.h
+++ b/embed/ephy-embed-shell.h
@@ -43,8 +43,6 @@ typedef struct _EphyEmbedShellClass EphyEmbedShellClass;
typedef struct _EphyEmbedShell EphyEmbedShell;
typedef struct _EphyEmbedShellPrivate EphyEmbedShellPrivate;
-extern EphyEmbedShell *embed_shell;
-
typedef enum
{
EPHY_EMBED_SHELL_MODE_BROWSER,
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index 52a218087..7752f0497 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -249,7 +249,7 @@ resource_request_starting_cb (WebKitWebView *web_view,
WebKitNetworkResponse *response,
EphyEmbed *embed)
{
- EphyAdBlockManager *adblock_manager = EPHY_ADBLOCK_MANAGER (ephy_embed_shell_get_adblock_manager (embed_shell));
+ EphyAdBlockManager *adblock_manager = EPHY_ADBLOCK_MANAGER (ephy_embed_shell_get_adblock_manager (ephy_embed_shell_get_default ()));
const char *uri = webkit_network_request_get_uri (request);
/* FIXME: How do we implement the other CHECK_TYPEs? Perhaps we
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 72f7b5ecd..09d23a4ac 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -165,7 +165,7 @@ popups_manager_show (PopupInfo *popup,
/* Only show popup with non NULL url */
if (popup->url != NULL) {
single = EPHY_EMBED_SINGLE
- (ephy_embed_shell_get_embed_single (embed_shell));
+ (ephy_embed_shell_get_embed_single (ephy_embed_shell_get_default ()));
ephy_embed_single_open_window (single, EPHY_EMBED (view), popup->url,
popup->name, popup->features);
@@ -292,7 +292,7 @@ ephy_web_view_set_popups_allowed (EphyWebView *view,
EphyPermission permission;
manager = EPHY_PERMISSION_MANAGER
- (ephy_embed_shell_get_embed_single (embed_shell));
+ (ephy_embed_shell_get_embed_single (ephy_embed_shell_get_default ()));
g_return_if_fail (EPHY_IS_PERMISSION_MANAGER (manager));
permission = allowed ? EPHY_PERMISSION_ALLOWED
@@ -321,7 +321,7 @@ ephy_web_view_get_popups_allowed (EphyWebView *view)
gboolean allow;
permission_manager = EPHY_PERMISSION_MANAGER
- (ephy_embed_shell_get_embed_single (embed_shell));
+ (ephy_embed_shell_get_embed_single (ephy_embed_shell_get_default ()));
g_return_val_if_fail (EPHY_IS_PERMISSION_MANAGER (permission_manager),
FALSE);
@@ -709,7 +709,7 @@ store_password (GtkInfoBar *info_bar, gint response_id, gpointer data)
/* Update internal caching */
host = ephy_string_get_host_name (uri);
- ephy_embed_single_add_form_auth (EPHY_EMBED_SINGLE (ephy_embed_shell_get_embed_single (embed_shell)),
+ ephy_embed_single_add_form_auth (EPHY_EMBED_SINGLE (ephy_embed_shell_get_embed_single (ephy_embed_shell_get_default ())),
host,
name_field_name,
password_field_name,
@@ -861,6 +861,7 @@ pre_fill_form (WebKitDOMNode *username_node,
GSList *p = NULL;
GSList *l = NULL;
SoupURI *uri = NULL;
+ EphyEmbedShell *embed_shell = ephy_embed_shell_get_default ();
uri = soup_uri_new (webkit_web_view_get_uri (WEBKIT_WEB_VIEW (view)));
if (uri)
@@ -1807,7 +1808,7 @@ decide_policy_cb (WebKitWebView *web_view,
if (g_strcmp0 (webkit_web_resource_get_uri (main_resource), request_uri) != 0)
return FALSE;
- single = ephy_embed_shell_get_embed_single (embed_shell);
+ single = ephy_embed_shell_get_embed_single (ephy_embed_shell_get_default ());
g_signal_emit_by_name (single, "handle-content", mime_type, request_uri, &handled);
if (handled)
@@ -1883,7 +1884,7 @@ mime_type_policy_decision_requested_cb (WebKitWebView *web_view,
const char *uri;
gboolean handled = FALSE;
- single = ephy_embed_shell_get_embed_single (embed_shell);
+ single = ephy_embed_shell_get_embed_single (ephy_embed_shell_get_default ());
uri = webkit_network_request_get_uri (request);
g_signal_emit_by_name (single, "handle-content", mime_type, uri, &handled);
@@ -2102,6 +2103,7 @@ web_view_check_snapshot (WebKitWebView *web_view)
EphyOverviewStore *store;
GtkTreeIter iter;
cairo_surface_t *surface;
+ EphyEmbedShell *embed_shell = ephy_embed_shell_get_default ();
store = EPHY_OVERVIEW_STORE (ephy_embed_shell_get_frecent_store (embed_shell));
if (ephy_overview_store_find_url (store, webkit_web_view_get_uri (web_view), &iter) &&
@@ -2212,7 +2214,7 @@ load_changed_cb (WebKitWebView *web_view,
#if 0
/* TODO: DOM bindings */
- if (ephy_embed_shell_get_mode (embed_shell) != EPHY_EMBED_SHELL_MODE_PRIVATE &&
+ if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) != EPHY_EMBED_SHELL_MODE_PRIVATE &&
g_settings_get_boolean (EPHY_SETTINGS_MAIN,
EPHY_PREFS_REMEMBER_PASSWORDS))
_ephy_web_view_hook_into_forms (view);
@@ -2368,7 +2370,7 @@ load_status_cb (WebKitWebView *web_view,
if (priv->is_blank)
ephy_web_view_set_title (view, NULL);
- if (ephy_embed_shell_get_mode (embed_shell) != EPHY_EMBED_SHELL_MODE_PRIVATE &&
+ if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) != EPHY_EMBED_SHELL_MODE_PRIVATE &&
g_settings_get_boolean (EPHY_SETTINGS_MAIN,
EPHY_PREFS_REMEMBER_PASSWORDS))
_ephy_web_view_hook_into_forms (view);
@@ -2759,7 +2761,7 @@ ephy_web_view_init (EphyWebView *web_view)
priv->domain_regex = g_regex_new (EPHY_WEB_VIEW_DOMAIN_REGEX,
G_REGEX_OPTIMIZE, G_REGEX_MATCH_NOTEMPTY, NULL);
- priv->history_service = EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service (embed_shell));
+ priv->history_service = EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service (ephy_embed_shell_get_default ()));
priv->history_service_cancellable = g_cancellable_new ();
g_signal_connect (priv->history_service,