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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 | 398 |
399 // If the user is navigating to a not-previously-typed intranet hostname, | 399 // If the user is navigating to a not-previously-typed intranet hostname, |
400 // change the transition to TYPED so that the omnibox will learn that this is | 400 // change the transition to TYPED so that the omnibox will learn that this is |
401 // a known host. | 401 // a known host. |
402 bool has_redirects = request.redirects.size() > 1; | 402 bool has_redirects = request.redirects.size() > 1; |
403 if (content::PageTransitionIsMainFrame(request_transition) && | 403 if (content::PageTransitionIsMainFrame(request_transition) && |
404 (stripped_transition != content::PAGE_TRANSITION_TYPED) && | 404 (stripped_transition != content::PAGE_TRANSITION_TYPED) && |
405 !is_keyword_generated) { | 405 !is_keyword_generated) { |
406 const GURL& origin_url(has_redirects ? | 406 const GURL& origin_url(has_redirects ? |
407 request.redirects[0] : request.url); | 407 request.redirects[0] : request.url); |
408 if (origin_url.SchemeIs(content::kHttpScheme) || | 408 if (origin_url.SchemeIs(url::kHttpScheme) || |
409 origin_url.SchemeIs(content::kHttpsScheme) || | 409 origin_url.SchemeIs(url::kHttpsScheme) || |
410 origin_url.SchemeIs(content::kFtpScheme)) { | 410 origin_url.SchemeIs(content::kFtpScheme)) { |
411 std::string host(origin_url.host()); | 411 std::string host(origin_url.host()); |
412 size_t registry_length = | 412 size_t registry_length = |
413 net::registry_controlled_domains::GetRegistryLength( | 413 net::registry_controlled_domains::GetRegistryLength( |
414 host, | 414 host, |
415 net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES, | 415 net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES, |
416 net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES); | 416 net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES); |
417 if (registry_length == 0 && !db_->IsTypedHost(host)) { | 417 if (registry_length == 0 && !db_->IsTypedHost(host)) { |
418 stripped_transition = content::PAGE_TRANSITION_TYPED; | 418 stripped_transition = content::PAGE_TRANSITION_TYPED; |
419 request_transition = | 419 request_transition = |
(...skipping 2528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2948 int rank = kPageVisitStatsMaxTopSites; | 2948 int rank = kPageVisitStatsMaxTopSites; |
2949 std::map<GURL, int>::const_iterator it = most_visited_urls_map_.find(url); | 2949 std::map<GURL, int>::const_iterator it = most_visited_urls_map_.find(url); |
2950 if (it != most_visited_urls_map_.end()) | 2950 if (it != most_visited_urls_map_.end()) |
2951 rank = (*it).second; | 2951 rank = (*it).second; |
2952 UMA_HISTOGRAM_ENUMERATION("History.TopSitesVisitsByRank", | 2952 UMA_HISTOGRAM_ENUMERATION("History.TopSitesVisitsByRank", |
2953 rank, kPageVisitStatsMaxTopSites + 1); | 2953 rank, kPageVisitStatsMaxTopSites + 1); |
2954 } | 2954 } |
2955 #endif | 2955 #endif |
2956 | 2956 |
2957 } // namespace history | 2957 } // namespace history |
OLD | NEW |