Bug 901234 - Stop using uriTypes (Places Session ids) in SeaMonkey code, r=Neil, a=me SEA_2_26_1_RELBRANCH
authorFrank Wein <mcsmurf@mcsmurf.de>
Wed, 05 Mar 2014 13:53:12 +0100
branchSEA_2_26_1_RELBRANCH
changeset 31059 9f7c2c32fad1af5b8ba4f35ad289e355c1b1d6ad
parent 31058 c9876da9d1ff84c54a6c5f00ff0827a0222ba1e0
child 31060 cfda76589359a95ab5057d5573fc1ada33630a39
push id1
push userclokep@gmail.com
push dateMon, 07 May 2018 22:45:56 +0000
treeherdercomm-esr60@57eacde5ef40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil, me
bugs901234
Bug 901234 - Stop using uriTypes (Places Session ids) in SeaMonkey code, r=Neil, a=me CLOSED TREE
suite/common/history/utils.js
suite/common/places/browserPlacesViews.js
suite/common/places/controller.js
suite/common/places/tree.xml
suite/common/src/PlacesUIUtils.jsm
--- a/suite/common/history/utils.js
+++ b/suite/common/history/utils.js
@@ -284,17 +284,17 @@ var PlacesUIUtils = {
         this.markPageAsTyped(aNode.uri);
         openUILinkIn(aNode.uri, aWhere);
       }
     }
   },
 
   getBestTitle: function PU_getBestTitle(aNode) {
     var title;
-    if (!aNode.title && PlacesUtils.uriTypes.indexOf(aNode.type) != -1) {
+    if (!aNode.title && PlacesUtils.nodeIsURI(aNode)) {
       // if node title is empty, try to set the label using host and filename
       // PlacesUtils._uri() will throw if aNode.uri is not a valid URI
       try {
         var uri = PlacesUtils._uri(aNode.uri);
         var host = uri.host;
         var fileName = uri.QueryInterface(Components.interfaces.nsIURL).fileName;
         // if fileName is empty, use path to distinguish labels
         title = host + (fileName ?
--- a/suite/common/places/browserPlacesViews.js
+++ b/suite/common/places/browserPlacesViews.js
@@ -290,17 +290,17 @@ PlacesViewBase.prototype = {
   function PVB__createMenuItemForPlacesNode(aPlacesNode) {
     this._domNodes.delete(aPlacesNode);
 
     let element;
     let type = aPlacesNode.type;
     if (type == Components.interfaces.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR)
       element = document.createElement("menuseparator");
     else {
-      if (PlacesUtils.uriTypes.indexOf(type) != -1) {
+      if (type == Components.interfaces.nsINavHistoryResultNode.RESULT_TYPE_URI) {
         element = document.createElement("menuitem");
         element.className = "menuitem-iconic bookmark-item menuitem-with-favicon";
         element.setAttribute("scheme",
                              PlacesUIUtils.guessUrlSchemeForUI(aPlacesNode.uri));
       }
       else if (PlacesUtils.containerTypes.indexOf(type) != -1) {
         element = document.createElement("menu");
         element.setAttribute("container", "true");
--- a/suite/common/places/controller.js
+++ b/suite/common/places/controller.js
@@ -456,17 +456,16 @@ PlacesController.prototype = {
         case Components.interfaces.nsINavHistoryResultNode.RESULT_TYPE_FOLDER:
         case Components.interfaces.nsINavHistoryResultNode.RESULT_TYPE_FOLDER_SHORTCUT:
           nodeData["folder"] = true;
           break;
         case Components.interfaces.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR:
           nodeData["separator"] = true;
           break;
         case Components.interfaces.nsINavHistoryResultNode.RESULT_TYPE_URI:
-        case Components.interfaces.nsINavHistoryResultNode.RESULT_TYPE_VISIT:
           nodeData["link"] = true;
           uri = PlacesUtils._uri(node.uri);
           if (PlacesUtils.nodeIsBookmark(node)) {
             nodeData["bookmark"] = true;
             PlacesUtils.nodeIsTagQuery(node.parent)
 
             var parentNode = node.parent;
             if (parentNode) {
--- a/suite/common/places/tree.xml
+++ b/suite/common/places/tree.xml
@@ -57,17 +57,17 @@
           var options = queryNode.queryOptions.clone();
 
           // Make sure we're getting uri results.
           // We do not yet support searching into grouped queries or into
           // tag containers, so we must fall to the default case.
           if (PlacesUtils.nodeIsHistoryContainer(queryNode) ||
               options.resultType == options.RESULTS_AS_TAG_QUERY ||
               options.resultType == options.RESULTS_AS_TAG_CONTENTS)
-            options.resultType = options.RESULT_TYPE_URI;
+            options.resultType = options.RESULTS_AS_URI;
 
           var query = PlacesUtils.history.getNewQuery();
           query.searchTerms = filterString;
 
           if (folderRestrict) {
             query.setFolders(folderRestrict, folderRestrict.length);
             options.queryType = options.QUERY_TYPE_BOOKMARKS;
           }
--- a/suite/common/src/PlacesUIUtils.jsm
+++ b/suite/common/src/PlacesUIUtils.jsm
@@ -890,17 +890,17 @@ var PlacesUIUtils = {
    * @note this is not supposed be perfect, so use it only for UI purposes.
    */
   guessUrlSchemeForUI: function PUIU_guessUrlSchemeForUI(aUrlString) {
     return aUrlString.substr(0, aUrlString.indexOf(":"));
   },
 
   getBestTitle: function PUIU_getBestTitle(aNode) {
     var title;
-    if (!aNode.title && PlacesUtils.uriTypes.indexOf(aNode.type) != -1) {
+    if (!aNode.title && PlacesUtils.nodeIsURI(aNode)) {
       // if node title is empty, try to set the label using host and filename
       // PlacesUtils._uri() will throw if aNode.uri is not a valid URI
       try {
         var uri = PlacesUtils._uri(aNode.uri);
         var host = uri.host;
         var fileName = uri.QueryInterface(Components.interfaces.nsIURL).fileName;
         // if fileName is empty, use path to distinguish labels
         title = host + (fileName ?