aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-web-view.c
diff options
context:
space:
mode:
authorAlejandro G. Castro <alex@igalia.com>2010-04-30 01:24:20 +0800
committerAlejandro G. Castro <alex@igalia.com>2010-05-02 23:09:56 +0800
commit4e914078cd832490b1d31804836f3ac2274fdaf0 (patch)
tree1925b670adeedbbab429ad189786b9d503b83919 /embed/ephy-web-view.c
parente355b448ed3f5002ba11e7e76a9de9c0d9630e6f (diff)
downloadgsoc2013-epiphany-4e914078cd832490b1d31804836f3ac2274fdaf0.tar
gsoc2013-epiphany-4e914078cd832490b1d31804836f3ac2274fdaf0.tar.gz
gsoc2013-epiphany-4e914078cd832490b1d31804836f3ac2274fdaf0.tar.bz2
gsoc2013-epiphany-4e914078cd832490b1d31804836f3ac2274fdaf0.tar.lz
gsoc2013-epiphany-4e914078cd832490b1d31804836f3ac2274fdaf0.tar.xz
gsoc2013-epiphany-4e914078cd832490b1d31804836f3ac2274fdaf0.tar.zst
gsoc2013-epiphany-4e914078cd832490b1d31804836f3ac2274fdaf0.zip
Removed the EphyWebViewNetState enum
We can use the webkit load status (WebKitLoadStatus) and avoid defining our own enum to check the net states. Bug #593743
Diffstat (limited to 'embed/ephy-web-view.c')
-rw-r--r--embed/ephy-web-view.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 2e084801e..26c5f3dd5 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -2340,7 +2340,7 @@ ensure_page_info (EphyWebView *view, const char *address)
}
static void
-update_net_state_message (EphyWebView *view, const char *uri, EphyWebViewNetState flags)
+update_net_state_message (EphyWebView *view, const char *uri, WebKitLoadStatus status)
{
const char *msg = NULL;
char *host = NULL;
@@ -2350,25 +2350,12 @@ update_net_state_message (EphyWebView *view, const char *uri, EphyWebViewNetStat
if (host == NULL) goto out;
- /* IS_REQUEST and IS_NETWORK can be both set */
- if (flags & EPHY_WEB_VIEW_STATE_IS_REQUEST) {
- if (flags & EPHY_WEB_VIEW_STATE_REDIRECTING) {
- msg = _ ("Redirecting to “%s”…");
- } else if (flags & EPHY_WEB_VIEW_STATE_TRANSFERRING) {
- msg = _ ("Transferring data from “%s”…");
- } else if (flags & EPHY_WEB_VIEW_STATE_NEGOTIATING) {
- msg = _ ("Waiting for authorization from “%s”…");
- }
- }
-
- if (flags & EPHY_WEB_VIEW_STATE_IS_NETWORK) {
- if (flags & EPHY_WEB_VIEW_STATE_START) {
+ /* FIXME: add REDIRECTING and NEGOTIATING states to WebKitGTK */
+ if (status == WEBKIT_LOAD_PROVISIONAL) {
msg = _ ("Loading “%s”…");
}
- }
- if ((flags & EPHY_WEB_VIEW_STATE_IS_NETWORK) &&
- (flags & EPHY_WEB_VIEW_STATE_STOP)) {
+ if (status == WEBKIT_LOAD_FINISHED) {
g_free (view->priv->status_message);
view->priv->status_message = NULL;
g_object_notify (G_OBJECT (view), "status-message");
@@ -2390,21 +2377,21 @@ update_net_state_message (EphyWebView *view, const char *uri, EphyWebViewNetStat
* ephy_web_view_update_from_net_state:
* @view: an #EphyWebView
* @uri: the uri associated with @view
- * @state: an #EphyWebViewNetState
+ * @state: a #WebKitLoadStatus
*
* Update @view at @uri with info from @state.
**/
void
ephy_web_view_update_from_net_state (EphyWebView *view,
const char *uri,
- EphyWebViewNetState state)
+ WebKitLoadStatus status)
{
EphyWebViewPrivate *priv = view->priv;
- update_net_state_message (view, uri, state);
+ update_net_state_message (view, uri, status);
- if (state & EPHY_WEB_VIEW_STATE_IS_NETWORK) {
- if (state & EPHY_WEB_VIEW_STATE_START) {
+ if (status == WEBKIT_LOAD_PROVISIONAL || status == WEBKIT_LOAD_FINISHED) {
+ if (status == WEBKIT_LOAD_PROVISIONAL) {
GObject *object = G_OBJECT (view);
g_object_freeze_notify (object);
@@ -2416,7 +2403,7 @@ ephy_web_view_update_from_net_state (EphyWebView *view,
g_object_notify (object, "embed-title");
g_object_thaw_notify (object);
- } else if (state & EPHY_WEB_VIEW_STATE_STOP) {
+ } else if (status == WEBKIT_LOAD_FINISHED) {
GObject *object = G_OBJECT (view);
g_object_freeze_notify (object);