Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: chrome/browser/history/history_backend.cc

Issue 273193004: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing files. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(url::kHttpScheme) || 408 if (origin_url.SchemeIs(url::kHttpScheme) ||
409 origin_url.SchemeIs(url::kHttpsScheme) || 409 origin_url.SchemeIs(url::kHttpsScheme) ||
410 origin_url.SchemeIs(content::kFtpScheme)) { 410 origin_url.SchemeIs(url::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 =
420 content::PageTransitionFromInt( 420 content::PageTransitionFromInt(
(...skipping 2527 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « chrome/browser/guest_view/web_view/web_view_guest.cc ('k') | chrome/browser/history/history_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698