| 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 // Update the referrer's duration. | 445 // Update the referrer's duration. |
| 446 UpdateVisitDuration(from_visit_id, request.time); | 446 UpdateVisitDuration(from_visit_id, request.time); |
| 447 } | 447 } |
| 448 } else { | 448 } else { |
| 449 // Redirect case. Add the redirect chain. | 449 // Redirect case. Add the redirect chain. |
| 450 | 450 |
| 451 content::PageTransition redirect_info = | 451 content::PageTransition redirect_info = |
| 452 content::PAGE_TRANSITION_CHAIN_START; | 452 content::PAGE_TRANSITION_CHAIN_START; |
| 453 | 453 |
| 454 RedirectList redirects = request.redirects; | 454 RedirectList redirects = request.redirects; |
| 455 if (redirects[0].SchemeIs(content::kAboutScheme)) { | 455 if (redirects[0].SchemeIs(url::kAboutScheme)) { |
| 456 // When the redirect source + referrer is "about" we skip it. This | 456 // When the redirect source + referrer is "about" we skip it. This |
| 457 // happens when a page opens a new frame/window to about:blank and then | 457 // happens when a page opens a new frame/window to about:blank and then |
| 458 // script sets the URL to somewhere else (used to hide the referrer). It | 458 // script sets the URL to somewhere else (used to hide the referrer). It |
| 459 // would be nice to keep all these redirects properly but we don't ever | 459 // would be nice to keep all these redirects properly but we don't ever |
| 460 // see the initial about:blank load, so we don't know where the | 460 // see the initial about:blank load, so we don't know where the |
| 461 // subsequent client redirect came from. | 461 // subsequent client redirect came from. |
| 462 // | 462 // |
| 463 // In this case, we just don't bother hooking up the source of the | 463 // In this case, we just don't bother hooking up the source of the |
| 464 // redirects, so we remove it. | 464 // redirects, so we remove it. |
| 465 redirects.erase(redirects.begin()); | 465 redirects.erase(redirects.begin()); |
| (...skipping 2483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2949 int rank = kPageVisitStatsMaxTopSites; | 2949 int rank = kPageVisitStatsMaxTopSites; |
| 2950 std::map<GURL, int>::const_iterator it = most_visited_urls_map_.find(url); | 2950 std::map<GURL, int>::const_iterator it = most_visited_urls_map_.find(url); |
| 2951 if (it != most_visited_urls_map_.end()) | 2951 if (it != most_visited_urls_map_.end()) |
| 2952 rank = (*it).second; | 2952 rank = (*it).second; |
| 2953 UMA_HISTOGRAM_ENUMERATION("History.TopSitesVisitsByRank", | 2953 UMA_HISTOGRAM_ENUMERATION("History.TopSitesVisitsByRank", |
| 2954 rank, kPageVisitStatsMaxTopSites + 1); | 2954 rank, kPageVisitStatsMaxTopSites + 1); |
| 2955 } | 2955 } |
| 2956 #endif | 2956 #endif |
| 2957 | 2957 |
| 2958 } // namespace history | 2958 } // namespace history |
| OLD | NEW |