web_view_notify_load_status_cb (GObject *object, GParamSpec *pspec, gpointer user_data)
{
  GoaWebView *self = GOA_WEB_VIEW (user_data);
  WebKitWebView *web_view = WEBKIT_WEB_VIEW (object);
  WebKitLoadStatus status;

  status = webkit_web_view_get_load_status (web_view);
  switch (status)
    {
    case WEBKIT_LOAD_PROVISIONAL:
      {
        WebKitNetworkRequest *request;
        WebKitWebDataSource *source;
        WebKitWebFrame *frame;
        const gchar *uri;
        gchar *title;

        frame = webkit_web_view_get_main_frame (web_view);
        source = webkit_web_frame_get_provisional_data_source (frame);
        request = webkit_web_data_source_get_initial_request (source);
        uri = webkit_network_request_get_uri (request);
        title = web_view_create_loading_title (uri);

        web_view_floating_bar_update (self, title);
        g_free (title);
        break;
      }

    case WEBKIT_LOAD_FAILED:
    case WEBKIT_LOAD_FINISHED:
      web_view_floating_bar_update (self, NULL);
      break;

    default:
      break;
    }
}
web_view_notify_load_status_cb (GObject *object, GParamSpec *pspec, gpointer user_data)
{
  GoaWebView *self = GOA_WEB_VIEW (user_data);
  WebKitWebView *web_view = WEBKIT_WEB_VIEW (object);
  WebKitLoadStatus status;

  status = webkit_web_view_get_load_status (web_view);
  switch (status)
    {
    case WEBKIT_LOAD_PROVISIONAL:
      {
        WebKitNetworkRequest *request;
        WebKitWebDataSource *source;
        WebKitWebFrame *frame;
        const gchar *uri;
        gchar *title;

        frame = webkit_web_view_get_main_frame (web_view);
        source = webkit_web_frame_get_provisional_data_source (frame);
        request = webkit_web_data_source_get_initial_request (source);
        uri = webkit_network_request_get_uri (request);
        title = web_view_create_loading_title (uri);

        web_view_floating_bar_update (self, title);
        g_free (title);
        break;
      }

    case WEBKIT_LOAD_FAILED:
    case WEBKIT_LOAD_FINISHED:
      web_view_floating_bar_update (self, NULL);
      break;

    default:
      break;
    }
}