| 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 | |
| 729 // typed, which would eliminate the need for this code. | |
| 730 int typed_increment = 0; | 728 int typed_increment = 0; |
| 731 ui::PageTransition transition_type = | 729 ui::PageTransition transition_type = |
| 732 ui::PageTransitionStripQualifier(transition); | 730 ui::PageTransitionStripQualifier(transition); |
| 733 if ((transition_type == ui::PAGE_TRANSITION_TYPED && | 731 if (ui::PageTransitionIsNewNavigation(transition) && |
| 734 !ui::PageTransitionIsRedirect(transition)) || | 732 ((transition_type == ui::PAGE_TRANSITION_TYPED && |
| 735 transition_type == ui::PAGE_TRANSITION_KEYWORD_GENERATED) | 733 !ui::PageTransitionIsRedirect(transition)) || |
| 734 transition_type == ui::PAGE_TRANSITION_KEYWORD_GENERATED)) |
| 736 typed_increment = 1; | 735 typed_increment = 1; |
| 737 | 736 |
| 738 // See if this URL is already in the DB. | 737 // See if this URL is already in the DB. |
| 739 URLRow url_info(url); | 738 URLRow url_info(url); |
| 740 URLID url_id = db_->GetRowForURL(url, &url_info); | 739 URLID url_id = db_->GetRowForURL(url, &url_info); |
| 741 if (url_id) { | 740 if (url_id) { |
| 742 // Update of an existing row. | 741 // Update of an existing row. |
| 743 if (ui::PageTransitionStripQualifier(transition) != | 742 if (ui::PageTransitionStripQualifier(transition) != |
| 744 ui::PAGE_TRANSITION_RELOAD) | 743 ui::PAGE_TRANSITION_RELOAD) |
| 745 url_info.set_visit_count(url_info.visit_count() + 1); | 744 url_info.set_visit_count(url_info.visit_count() + 1); |
| (...skipping 1915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2661 info.url_id = visit.url_id; | 2660 info.url_id = visit.url_id; |
| 2662 info.time = visit.visit_time; | 2661 info.time = visit.visit_time; |
| 2663 info.transition = visit.transition; | 2662 info.transition = visit.transition; |
| 2664 // If we don't have a delegate yet during setup or shutdown, we will drop | 2663 // If we don't have a delegate yet during setup or shutdown, we will drop |
| 2665 // these notifications. | 2664 // these notifications. |
| 2666 if (delegate_) | 2665 if (delegate_) |
| 2667 delegate_->NotifyAddVisit(info); | 2666 delegate_->NotifyAddVisit(info); |
| 2668 } | 2667 } |
| 2669 | 2668 |
| 2670 } // namespace history | 2669 } // namespace history |
| OLD | NEW |