Bug 856208 - Stop using global-history;2 in SeaMonkey code, r=Neil
authorFrank Wein <mcsmurf@mcsmurf.de>
Mon, 01 Apr 2013 02:10:39 +0200
changeset 12239 b8bc5996f9ba780b425a67e44e6b25dc8dee68c4
parent 12238 2ac76ca7fbda48721add3975a3d1999ba9d07bed
child 12240 71de34b00fc20464e1589d603a14f16fd0bdfaec
push id9057
push usermcsmurf@mcsmurf.de
push dateMon, 01 Apr 2013 00:11:16 +0000
treeherdercomm-central@b8bc5996f9ba [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil
bugs856208
Bug 856208 - Stop using global-history;2 in SeaMonkey code, r=Neil
suite/common/contentAreaClick.js
suite/common/pref/pref-history.js
suite/modules/Sanitizer.jsm
--- a/suite/common/contentAreaClick.js
+++ b/suite/common/contentAreaClick.js
@@ -205,18 +205,18 @@
     aUrlToAdd = aUrlToAdd.trim();
 
     if (!aUrlToAdd)
       return;
     if (aUrlToAdd.search(/[\x00-\x1F]/) != -1) // don't store bad URLs
       return;
 
     if (!gGlobalHistory)
-      gGlobalHistory = Components.classes["@mozilla.org/browser/global-history;2"]
-                                 .getService(Components.interfaces.nsIBrowserHistory);
+      gGlobalHistory = Components.classes["@mozilla.org/browser/nav-history-service;1"]
+                                 .getService(Components.interfaces.nsINavHistoryService);
 
     if (!gURIFixup)
       gURIFixup = Components.classes["@mozilla.org/docshell/urifixup;1"]
                             .getService(Components.interfaces.nsIURIFixup);
 
     try {
       var url = getShortcutOrURI(aUrlToAdd);
       var fixedUpURI = gURIFixup.createFixupURI(url, 0);
--- a/suite/common/pref/pref-history.js
+++ b/suite/common/pref/pref-history.js
@@ -19,25 +19,25 @@ function Startup()
       }
     }
     urlbarHistButton.disabled = isBtnDisabled;
   }
   catch(ex) {
   }
     
   var globalHistButton = document.getElementById("browserClearHistory");
-  var globalHistory = Components.classes["@mozilla.org/browser/global-history;2"]
-                                .getService(Components.interfaces.nsIBrowserHistory);
-  if (globalHistory.count == 0)
+  var globalHistory = Components.classes["@mozilla.org/browser/nav-history-service;1"]
+                                .getService(Components.interfaces.nsINavHistoryService);
+  if (!globalHistory.hasHistoryEntries)
     globalHistButton.disabled = true;
 }
 
 function prefClearGlobalHistory()
 {
-  var globalHistory = Components.classes["@mozilla.org/browser/global-history;2"]
+  var globalHistory = Components.classes["@mozilla.org/browser/nav-history-service;1"]
                                 .getService(Components.interfaces.nsIBrowserHistory);
   globalHistory.removeAllPages();
 }
 
 function prefClearUrlbarHistory()
 {
   document.getElementById("general.open_location.last_url").valueFromPreferences = "";
   var file = GetUrlbarHistoryFile();
--- a/suite/modules/Sanitizer.jsm
+++ b/suite/modules/Sanitizer.jsm
@@ -169,17 +169,17 @@ var Sanitizer = {
 
       canClear: true
     },
 
     history: {
       clear: function() {
         // use try/catch for everything but the last task so we clear as much as possible
         try {
-          var globalHistory = Components.classes["@mozilla.org/browser/global-history;2"]
+          var globalHistory = Components.classes["@mozilla.org/browser/nav-history-service;1"]
                                         .getService(Components.interfaces.nsIBrowserHistory);
           globalHistory.removeAllPages();
         } catch(ex) {}
 
         try {
           var os = Components.classes["@mozilla.org/observer-service;1"]
                              .getService(Components.interfaces.nsIObserverService);
           os.notifyObservers(null, "browser:purge-session-history", "");