Bug 400543 - Add TRANSITION_DOWNLOAD. r=mano, a=schrep
authorsdwilsh@shawnwilsher.com
Mon, 12 Nov 2007 18:54:32 -0800
changeset 7887 28f6a94edb58e37960b90eecd1b5c34fafc09c41
parent 7886 c6686937938807889e7db5bfd943dced94859a4a
child 7888 cb33f1c7d8509631d3566011bdfe14fb2290bb0d
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherderautoland@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmano, schrep
bugs400543
milestone1.9b2pre
Bug 400543 - Add TRANSITION_DOWNLOAD. r=mano, a=schrep
toolkit/components/places/public/nsINavHistoryService.idl
toolkit/components/places/src/nsNavHistory.cpp
--- a/toolkit/components/places/public/nsINavHistoryService.idl
+++ b/toolkit/components/places/public/nsINavHistoryService.idl
@@ -1195,16 +1195,21 @@ interface nsINavHistoryService : nsISupp
   const unsigned long TRANSITION_REDIRECT_PERMANENT = 5;
 
   /**
    * Set when the transition was a temporary redirect.
    */
   const unsigned long TRANSITION_REDIRECT_TEMPORARY = 6;
 
   /**
+   * Set when the transition is a download.
+   */
+  const unsigned long TRANSITION_DOWNLOAD = 7;
+
+  /**
    * True if there is any history. This can be used in UI to determine whether
    * the "clear history" button should be enabled or not. This is much better
    * than using BrowserHistory.count since that can be very slow if there is
    * a lot of history (it must enumerate each item). This is pretty fast.
    */
   readonly attribute boolean hasHistoryEntries;
 
   /**
--- a/toolkit/components/places/src/nsNavHistory.cpp
+++ b/toolkit/components/places/src/nsNavHistory.cpp
@@ -1955,19 +1955,20 @@ nsNavHistory::AddVisit(nsIURI* aURI, PRT
   } else {
     // New page
     newItem = PR_TRUE;
 
     // free the previous statement before we make a new one
     mDBGetPageVisitStats->Reset();
     scoper.Abandon();
 
-    // hide embedded links and redirects, everything else is visible,
+    // Hide only embedded links, redirects, and downloads
     // See the hidden computation code above for a little more explanation.
-    hidden = (aTransitionType == TRANSITION_EMBED || aIsRedirect);
+    hidden = (aTransitionType == TRANSITION_EMBED || aIsRedirect ||
+              aTransitionType == TRANSITION_DOWNLOAD);
 
     typed = (aTransitionType == TRANSITION_TYPED);
 
     // set as visited once, no title
     nsString voidString;
     voidString.SetIsVoid(PR_TRUE);
     rv = InternalAddNewPage(aURI, voidString, hidden, typed, 1, &pageID);
     NS_ENSURE_SUCCESS(rv, rv);