[epiphany] ephy-web-view: make ephy_web_view_clear_history private



commit 00276359e926f4f1fba732534a0b47bec88371f5
Author: Xan Lopez <xan igalia com>
Date:   Thu Mar 15 09:34:23 2012 +0100

    ephy-web-view: make ephy_web_view_clear_history private
    
    It's only used by the class itself now.

 embed/ephy-web-view.c |  100 +++++++++++++++++++++++--------------------------
 embed/ephy-web-view.h |    1 -
 2 files changed, 47 insertions(+), 54 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index c0b59db..d7aeb61 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1045,6 +1045,53 @@ _ephy_web_view_hook_into_links (EphyWebView *web_view)
 }
 
 static void
+update_navigation_flags (EphyWebView *view)
+{
+  EphyWebViewPrivate *priv = view->priv;
+  guint flags = 0;
+  WebKitWebView *web_view = WEBKIT_WEB_VIEW (view);
+
+  if (ephy_web_view_can_go_up (view))
+    flags |= EPHY_WEB_VIEW_NAV_UP;
+
+  if (webkit_web_view_can_go_back (web_view))
+    flags |= EPHY_WEB_VIEW_NAV_BACK;
+
+  if (webkit_web_view_can_go_forward (web_view))
+    flags |= EPHY_WEB_VIEW_NAV_FORWARD;
+
+  if (priv->nav_flags != (EphyWebViewNavigationFlags)flags) {
+    priv->nav_flags = (EphyWebViewNavigationFlags)flags;
+
+    g_object_notify (G_OBJECT (view), "navigation");
+  }
+}
+
+static void
+ephy_web_view_clear_history (EphyWebView *view)
+{
+  WebKitWebBackForwardList *history_list;
+
+  g_return_if_fail (EPHY_IS_WEB_VIEW (view));
+
+  history_list = webkit_web_view_get_back_forward_list (WEBKIT_WEB_VIEW (view));
+  if (history_list != NULL) {
+    WebKitWebHistoryItem *current_item;
+
+    /* Save a ref to the first element to add it later */
+    current_item = webkit_web_back_forward_list_get_current_item (history_list);
+    g_object_ref (current_item);
+
+    /* Clear the history and add the first element once again */
+    webkit_web_back_forward_list_clear (history_list);
+    webkit_web_back_forward_list_add_item (history_list, current_item);
+    g_object_unref (current_item);
+
+    update_navigation_flags (view);
+  }
+}
+
+static void
 ephy_web_view_history_cleared_cb (EphyHistoryService *history_service,
                                   EphyWebView *view)
 {
@@ -1807,29 +1854,6 @@ geolocation_policy_decision_requested_cb (WebKitWebView *web_view,
   return TRUE;
 }
 
-static void
-update_navigation_flags (EphyWebView *view)
-{
-  EphyWebViewPrivate *priv = view->priv;
-  guint flags = 0;
-  WebKitWebView *web_view = WEBKIT_WEB_VIEW (view);
-
-  if (ephy_web_view_can_go_up (view))
-    flags |= EPHY_WEB_VIEW_NAV_UP;
-
-  if (webkit_web_view_can_go_back (web_view))
-    flags |= EPHY_WEB_VIEW_NAV_BACK;
-
-  if (webkit_web_view_can_go_forward (web_view))
-    flags |= EPHY_WEB_VIEW_NAV_FORWARD;
-
-  if (priv->nav_flags != (EphyWebViewNavigationFlags)flags) {
-    priv->nav_flags = (EphyWebViewNavigationFlags)flags;
-
-    g_object_notify (G_OBJECT (view), "navigation");
-  }
-}
-
 static gboolean
 delete_web_app_cb (WebKitDOMHTMLElement *button,
                    WebKitDOMEvent *dom_event,
@@ -2625,36 +2649,6 @@ ephy_web_view_copy_back_history (EphyWebView *source,
 }
 
 /**
- * ephy_web_view_clear_history:
- * @view: the #EphyWebView to clear the history from
- *
- * Clears history of @view.
- **/
-void
-ephy_web_view_clear_history (EphyWebView *view)
-{
-  WebKitWebBackForwardList *history_list;
-
-  g_return_if_fail (EPHY_IS_WEB_VIEW (view));
-
-  history_list = webkit_web_view_get_back_forward_list (WEBKIT_WEB_VIEW (view));
-  if (history_list != NULL) {
-    WebKitWebHistoryItem *current_item;
-
-    /* Save a ref to the first element to add it later */
-    current_item = webkit_web_back_forward_list_get_current_item (history_list);
-    g_object_ref (current_item);
-
-    /* Clear the history and add the first element once again */
-    webkit_web_back_forward_list_clear (history_list);
-    webkit_web_back_forward_list_add_item (history_list, current_item);
-    g_object_unref (current_item);
-
-    update_navigation_flags (view);
-  }
-}
-
-/**
  * ephy_web_view_set_is_blank:
  * @view: an #EphyWebView
  * @is_blank: if @view is the blank page
diff --git a/embed/ephy-web-view.h b/embed/ephy-web-view.h
index d1888c8..d3e4229 100644
--- a/embed/ephy-web-view.h
+++ b/embed/ephy-web-view.h
@@ -134,7 +134,6 @@ void                       ephy_web_view_load_url                 (EphyWebView
                                                                    const char                *url);
 void                       ephy_web_view_copy_back_history        (EphyWebView               *source,
                                                                    EphyWebView               *dest);
-void                       ephy_web_view_clear_history            (EphyWebView               *view);
 gboolean                   ephy_web_view_is_loading               (EphyWebView               *view);
 const char *               ephy_web_view_get_loading_title        (EphyWebView               *view);
 GdkPixbuf *                ephy_web_view_get_icon                 (EphyWebView               *view);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]