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 "components/history/core/browser/history_backend.h" | 5 #include "components/history/core/browser/history_backend.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
718 const GURL& url, | 718 const GURL& url, |
719 Time time, | 719 Time time, |
720 VisitID referring_visit, | 720 VisitID referring_visit, |
721 ui::PageTransition transition, | 721 ui::PageTransition transition, |
722 VisitSource visit_source) { | 722 VisitSource visit_source) { |
723 // Top-level frame navigations are visible, everything else is hidden | 723 // Top-level frame navigations are visible, everything else is hidden |
724 bool new_hidden = !ui::PageTransitionIsMainFrame(transition); | 724 bool new_hidden = !ui::PageTransitionIsMainFrame(transition); |
725 | 725 |
726 // NOTE: This code must stay in sync with | 726 // NOTE: This code must stay in sync with |
727 // ExpireHistoryBackend::ExpireURLsForVisits(). | 727 // ExpireHistoryBackend::ExpireURLsForVisits(). |
728 // TODO(pkasting): http://b/1148304 We shouldn't be marking so many URLs as | 728 // TODO(pkasting): http://b/1148304 We shouldn't be marking so many URLs as |
Mark P
2015/03/24 18:03:01
Can you clean up this comment too?
| |
729 // typed, which would eliminate the need for this code. | 729 // typed, which would eliminate the need for this code. |
730 int typed_increment = 0; | 730 int typed_increment = 0; |
731 ui::PageTransition transition_type = | 731 ui::PageTransition transition_type = |
732 ui::PageTransitionStripQualifier(transition); | 732 ui::PageTransitionStripQualifier(transition); |
733 if ((transition_type == ui::PAGE_TRANSITION_TYPED && | 733 if ((transition_type == ui::PAGE_TRANSITION_TYPED && |
734 ui::PageTransitionIsNewNavigation(transition) && | |
734 !ui::PageTransitionIsRedirect(transition)) || | 735 !ui::PageTransitionIsRedirect(transition)) || |
735 transition_type == ui::PAGE_TRANSITION_KEYWORD_GENERATED) | 736 transition_type == ui::PAGE_TRANSITION_KEYWORD_GENERATED) |
736 typed_increment = 1; | 737 typed_increment = 1; |
737 | 738 |
738 // See if this URL is already in the DB. | 739 // See if this URL is already in the DB. |
739 URLRow url_info(url); | 740 URLRow url_info(url); |
740 URLID url_id = db_->GetRowForURL(url, &url_info); | 741 URLID url_id = db_->GetRowForURL(url, &url_info); |
741 if (url_id) { | 742 if (url_id) { |
742 // Update of an existing row. | 743 // Update of an existing row. |
743 if (ui::PageTransitionStripQualifier(transition) != | 744 if (ui::PageTransitionStripQualifier(transition) != |
(...skipping 1917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2661 info.url_id = visit.url_id; | 2662 info.url_id = visit.url_id; |
2662 info.time = visit.visit_time; | 2663 info.time = visit.visit_time; |
2663 info.transition = visit.transition; | 2664 info.transition = visit.transition; |
2664 // If we don't have a delegate yet during setup or shutdown, we will drop | 2665 // If we don't have a delegate yet during setup or shutdown, we will drop |
2665 // these notifications. | 2666 // these notifications. |
2666 if (delegate_) | 2667 if (delegate_) |
2667 delegate_->NotifyAddVisit(info); | 2668 delegate_->NotifyAddVisit(info); |
2668 } | 2669 } |
2669 | 2670 |
2670 } // namespace history | 2671 } // namespace history |
OLD | NEW |