| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/history/expire_history_backend.h" | 5 #include "chrome/browser/history/expire_history_backend.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // Returns true if this visit is worth archiving. Otherwise, this visit is not | 96 // Returns true if this visit is worth archiving. Otherwise, this visit is not |
| 97 // worth saving (for example, subframe navigations and redirects) and we can | 97 // worth saving (for example, subframe navigations and redirects) and we can |
| 98 // just delete it when it gets old. | 98 // just delete it when it gets old. |
| 99 bool ShouldArchiveVisit(const VisitRow& visit) { | 99 bool ShouldArchiveVisit(const VisitRow& visit) { |
| 100 int no_qualifier = content::PageTransitionStripQualifier(visit.transition); | 100 int no_qualifier = content::PageTransitionStripQualifier(visit.transition); |
| 101 | 101 |
| 102 // These types of transitions are always "important" and the user will want | 102 // These types of transitions are always "important" and the user will want |
| 103 // to see them. | 103 // to see them. |
| 104 if (no_qualifier == content::PAGE_TRANSITION_TYPED || | 104 if (no_qualifier == content::PAGE_TRANSITION_TYPED || |
| 105 no_qualifier == content::PAGE_TRANSITION_AUTO_BOOKMARK || | 105 no_qualifier == content::PAGE_TRANSITION_AUTO_BOOKMARK || |
| 106 no_qualifier == content::PAGE_TRANSITION_START_PAGE) | 106 no_qualifier == content::PAGE_TRANSITION_AUTO_TOPLEVEL) |
| 107 return true; | 107 return true; |
| 108 | 108 |
| 109 // Only archive these "less important" transitions when they were the final | 109 // Only archive these "less important" transitions when they were the final |
| 110 // navigation and not part of a redirect chain. | 110 // navigation and not part of a redirect chain. |
| 111 if ((no_qualifier == content::PAGE_TRANSITION_LINK || | 111 if ((no_qualifier == content::PAGE_TRANSITION_LINK || |
| 112 no_qualifier == content::PAGE_TRANSITION_FORM_SUBMIT || | 112 no_qualifier == content::PAGE_TRANSITION_FORM_SUBMIT || |
| 113 no_qualifier == content::PAGE_TRANSITION_KEYWORD || | 113 no_qualifier == content::PAGE_TRANSITION_KEYWORD || |
| 114 no_qualifier == content::PAGE_TRANSITION_GENERATED) && | 114 no_qualifier == content::PAGE_TRANSITION_GENERATED) && |
| 115 visit.transition & content::PAGE_TRANSITION_CHAIN_END) | 115 visit.transition & content::PAGE_TRANSITION_CHAIN_END) |
| 116 return true; | 116 return true; |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 // We use the bookmark service to determine if a URL is bookmarked. The | 715 // We use the bookmark service to determine if a URL is bookmarked. The |
| 716 // bookmark service is loaded on a separate thread and may not be done by the | 716 // bookmark service is loaded on a separate thread and may not be done by the |
| 717 // time we get here. We therefor block until the bookmarks have finished | 717 // time we get here. We therefor block until the bookmarks have finished |
| 718 // loading. | 718 // loading. |
| 719 if (bookmark_service_) | 719 if (bookmark_service_) |
| 720 bookmark_service_->BlockTillLoaded(); | 720 bookmark_service_->BlockTillLoaded(); |
| 721 return bookmark_service_; | 721 return bookmark_service_; |
| 722 } | 722 } |
| 723 | 723 |
| 724 } // namespace history | 724 } // namespace history |
| OLD | NEW |