| 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/history_backend.h" | 5 #include "chrome/browser/history/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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 | 804 |
| 805 // Broadcast a notification of the visit. | 805 // Broadcast a notification of the visit. |
| 806 if (visit_id) { | 806 if (visit_id) { |
| 807 if (typed_url_syncable_service_.get()) | 807 if (typed_url_syncable_service_.get()) |
| 808 typed_url_syncable_service_->OnUrlVisited(transition, &url_info); | 808 typed_url_syncable_service_->OnUrlVisited(transition, &url_info); |
| 809 | 809 |
| 810 RedirectList redirects; | 810 RedirectList redirects; |
| 811 // TODO(meelapshah) Disabled due to potential PageCycler regression. | 811 // TODO(meelapshah) Disabled due to potential PageCycler regression. |
| 812 // Re-enable this. | 812 // Re-enable this. |
| 813 // QueryRedirectsTo(url, &redirects); | 813 // QueryRedirectsTo(url, &redirects); |
| 814 NotifyAddVisit(transition, url_info, redirects, time); | 814 NotifyURLVisited(transition, url_info, redirects, time); |
| 815 | 815 |
| 816 // TODO(sdefresne): turn HistoryBackend::Delegate from HistoryService into | 816 // TODO(sdefresne): turn HistoryBackend::Delegate from HistoryService into |
| 817 // an HistoryBackendObserver and register it so that we can remove this | 817 // an HistoryBackendObserver and register it so that we can remove this |
| 818 // method. | 818 // method. |
| 819 if (delegate_) | 819 if (delegate_) |
| 820 delegate_->NotifyURLVisited(transition, url_info, redirects, time); | 820 delegate_->NotifyURLVisited(transition, url_info, redirects, time); |
| 821 } else { | 821 } else { |
| 822 VLOG(0) << "Failed to build visit insert statement: " | 822 VLOG(0) << "Failed to build visit insert statement: " |
| 823 << "url_id = " << url_id; | 823 << "url_id = " << url_id; |
| 824 } | 824 } |
| 825 | 825 |
| 826 return std::make_pair(url_id, visit_id); | 826 return std::make_pair(url_id, visit_id); |
| 827 } | 827 } |
| 828 | 828 |
| 829 void HistoryBackend::NotifyAddVisit(ui::PageTransition transition, | 829 void HistoryBackend::NotifyURLVisited(ui::PageTransition transition, |
| 830 const URLRow& row, | 830 const URLRow& row, |
| 831 const RedirectList& redirects, | 831 const RedirectList& redirects, |
| 832 base::Time visit_time) { | 832 base::Time visit_time) { |
| 833 FOR_EACH_OBSERVER( | 833 FOR_EACH_OBSERVER( |
| 834 HistoryBackendObserver, | 834 HistoryBackendObserver, |
| 835 observers_, | 835 observers_, |
| 836 OnURLVisited(this, transition, row, redirects, visit_time)); | 836 OnURLVisited(this, transition, row, redirects, visit_time)); |
| 837 } | 837 } |
| 838 | 838 |
| 839 void HistoryBackend::AddPagesWithDetails(const URLRows& urls, | 839 void HistoryBackend::AddPagesWithDetails(const URLRows& urls, |
| 840 VisitSource visit_source) { | 840 VisitSource visit_source) { |
| 841 if (!db_) | 841 if (!db_) |
| 842 return; | 842 return; |
| (...skipping 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2726 int rank = kPageVisitStatsMaxTopSites; | 2726 int rank = kPageVisitStatsMaxTopSites; |
| 2727 std::map<GURL, int>::const_iterator it = most_visited_urls_map_.find(url); | 2727 std::map<GURL, int>::const_iterator it = most_visited_urls_map_.find(url); |
| 2728 if (it != most_visited_urls_map_.end()) | 2728 if (it != most_visited_urls_map_.end()) |
| 2729 rank = (*it).second; | 2729 rank = (*it).second; |
| 2730 UMA_HISTOGRAM_ENUMERATION("History.TopSitesVisitsByRank", | 2730 UMA_HISTOGRAM_ENUMERATION("History.TopSitesVisitsByRank", |
| 2731 rank, kPageVisitStatsMaxTopSites + 1); | 2731 rank, kPageVisitStatsMaxTopSites + 1); |
| 2732 } | 2732 } |
| 2733 #endif | 2733 #endif |
| 2734 | 2734 |
| 2735 } // namespace history | 2735 } // namespace history |
| OLD | NEW |