| 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 // change the transition to TYPED so that the omnibox will learn that this is | 402 // change the transition to TYPED so that the omnibox will learn that this is |
| 403 // a known host. | 403 // a known host. |
| 404 bool has_redirects = request.redirects.size() > 1; | 404 bool has_redirects = request.redirects.size() > 1; |
| 405 if (content::PageTransitionIsMainFrame(request_transition) && | 405 if (content::PageTransitionIsMainFrame(request_transition) && |
| 406 (stripped_transition != content::PAGE_TRANSITION_TYPED) && | 406 (stripped_transition != content::PAGE_TRANSITION_TYPED) && |
| 407 !is_keyword_generated) { | 407 !is_keyword_generated) { |
| 408 const GURL& origin_url(has_redirects ? | 408 const GURL& origin_url(has_redirects ? |
| 409 request.redirects[0] : request.url); | 409 request.redirects[0] : request.url); |
| 410 if (origin_url.SchemeIs(content::kHttpScheme) || | 410 if (origin_url.SchemeIs(content::kHttpScheme) || |
| 411 origin_url.SchemeIs(content::kHttpsScheme) || | 411 origin_url.SchemeIs(content::kHttpsScheme) || |
| 412 origin_url.SchemeIs(chrome::kFtpScheme)) { | 412 origin_url.SchemeIs(content::kFtpScheme)) { |
| 413 std::string host(origin_url.host()); | 413 std::string host(origin_url.host()); |
| 414 size_t registry_length = | 414 size_t registry_length = |
| 415 net::registry_controlled_domains::GetRegistryLength( | 415 net::registry_controlled_domains::GetRegistryLength( |
| 416 host, | 416 host, |
| 417 net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES, | 417 net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES, |
| 418 net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES); | 418 net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES); |
| 419 if (registry_length == 0 && !db_->IsTypedHost(host)) { | 419 if (registry_length == 0 && !db_->IsTypedHost(host)) { |
| 420 stripped_transition = content::PAGE_TRANSITION_TYPED; | 420 stripped_transition = content::PAGE_TRANSITION_TYPED; |
| 421 request_transition = | 421 request_transition = |
| 422 content::PageTransitionFromInt( | 422 content::PageTransitionFromInt( |
| (...skipping 2526 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 |