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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 | 405 |
406 // If the user is navigating to a not-previously-typed intranet hostname, | 406 // If the user is navigating to a not-previously-typed intranet hostname, |
407 // change the transition to TYPED so that the omnibox will learn that this is | 407 // change the transition to TYPED so that the omnibox will learn that this is |
408 // a known host. | 408 // a known host. |
409 bool has_redirects = request.redirects.size() > 1; | 409 bool has_redirects = request.redirects.size() > 1; |
410 if (content::PageTransitionIsMainFrame(request_transition) && | 410 if (content::PageTransitionIsMainFrame(request_transition) && |
411 (stripped_transition != content::PAGE_TRANSITION_TYPED) && | 411 (stripped_transition != content::PAGE_TRANSITION_TYPED) && |
412 !is_keyword_generated) { | 412 !is_keyword_generated) { |
413 const GURL& origin_url(has_redirects ? | 413 const GURL& origin_url(has_redirects ? |
414 request.redirects[0] : request.url); | 414 request.redirects[0] : request.url); |
415 if (origin_url.SchemeIs(chrome::kHttpScheme) || | 415 if (origin_url.SchemeIs(content::kHttpScheme) || |
416 origin_url.SchemeIs(content::kHttpsScheme) || | 416 origin_url.SchemeIs(content::kHttpsScheme) || |
417 origin_url.SchemeIs(chrome::kFtpScheme)) { | 417 origin_url.SchemeIs(chrome::kFtpScheme)) { |
418 std::string host(origin_url.host()); | 418 std::string host(origin_url.host()); |
419 size_t registry_length = | 419 size_t registry_length = |
420 net::registry_controlled_domains::GetRegistryLength( | 420 net::registry_controlled_domains::GetRegistryLength( |
421 host, | 421 host, |
422 net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES, | 422 net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES, |
423 net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES); | 423 net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES); |
424 if (registry_length == 0 && !db_->IsTypedHost(host)) { | 424 if (registry_length == 0 && !db_->IsTypedHost(host)) { |
425 stripped_transition = content::PAGE_TRANSITION_TYPED; | 425 stripped_transition = content::PAGE_TRANSITION_TYPED; |
(...skipping 2436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2862 int rank = kPageVisitStatsMaxTopSites; | 2862 int rank = kPageVisitStatsMaxTopSites; |
2863 std::map<GURL, int>::const_iterator it = most_visited_urls_map_.find(url); | 2863 std::map<GURL, int>::const_iterator it = most_visited_urls_map_.find(url); |
2864 if (it != most_visited_urls_map_.end()) | 2864 if (it != most_visited_urls_map_.end()) |
2865 rank = (*it).second; | 2865 rank = (*it).second; |
2866 UMA_HISTOGRAM_ENUMERATION("History.TopSitesVisitsByRank", | 2866 UMA_HISTOGRAM_ENUMERATION("History.TopSitesVisitsByRank", |
2867 rank, kPageVisitStatsMaxTopSites + 1); | 2867 rank, kPageVisitStatsMaxTopSites + 1); |
2868 } | 2868 } |
2869 #endif | 2869 #endif |
2870 | 2870 |
2871 } // namespace history | 2871 } // namespace history |
OLD | NEW |