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

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

Issue 254763005: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial patches. Created 6 years, 8 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 24 matching lines...) Expand all
35 #include "chrome/browser/history/top_sites.h" 35 #include "chrome/browser/history/top_sites.h"
36 #include "chrome/browser/history/typed_url_syncable_service.h" 36 #include "chrome/browser/history/typed_url_syncable_service.h"
37 #include "chrome/browser/history/visit_filter.h" 37 #include "chrome/browser/history/visit_filter.h"
38 #include "chrome/common/chrome_constants.h" 38 #include "chrome/common/chrome_constants.h"
39 #include "chrome/common/importer/imported_favicon_usage.h" 39 #include "chrome/common/importer/imported_favicon_usage.h"
40 #include "chrome/common/url_constants.h" 40 #include "chrome/common/url_constants.h"
41 #include "components/bookmarks/core/browser/bookmark_service.h" 41 #include "components/bookmarks/core/browser/bookmark_service.h"
42 #include "grit/chromium_strings.h" 42 #include "grit/chromium_strings.h"
43 #include "grit/generated_resources.h" 43 #include "grit/generated_resources.h"
44 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" 44 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
45 #include "net/base/url_constants.h"
45 #include "sql/error_delegate_util.h" 46 #include "sql/error_delegate_util.h"
46 #include "url/gurl.h" 47 #include "url/gurl.h"
47 48
48 #if defined(OS_ANDROID) 49 #if defined(OS_ANDROID)
49 #include "chrome/browser/history/android/android_provider_backend.h" 50 #include "chrome/browser/history/android/android_provider_backend.h"
50 #endif 51 #endif
51 52
52 using base::Time; 53 using base::Time;
53 using base::TimeDelta; 54 using base::TimeDelta;
54 using base::TimeTicks; 55 using base::TimeTicks;
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 399
399 // If the user is navigating to a not-previously-typed intranet hostname, 400 // 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 401 // change the transition to TYPED so that the omnibox will learn that this is
401 // a known host. 402 // a known host.
402 bool has_redirects = request.redirects.size() > 1; 403 bool has_redirects = request.redirects.size() > 1;
403 if (content::PageTransitionIsMainFrame(request_transition) && 404 if (content::PageTransitionIsMainFrame(request_transition) &&
404 (stripped_transition != content::PAGE_TRANSITION_TYPED) && 405 (stripped_transition != content::PAGE_TRANSITION_TYPED) &&
405 !is_keyword_generated) { 406 !is_keyword_generated) {
406 const GURL& origin_url(has_redirects ? 407 const GURL& origin_url(has_redirects ?
407 request.redirects[0] : request.url); 408 request.redirects[0] : request.url);
408 if (origin_url.SchemeIs(content::kHttpScheme) || 409 if (origin_url.SchemeIs(net::kHttpScheme) ||
409 origin_url.SchemeIs(content::kHttpsScheme) || 410 origin_url.SchemeIs(net::kHttpsScheme) ||
410 origin_url.SchemeIs(content::kFtpScheme)) { 411 origin_url.SchemeIs(content::kFtpScheme)) {
411 std::string host(origin_url.host()); 412 std::string host(origin_url.host());
412 size_t registry_length = 413 size_t registry_length =
413 net::registry_controlled_domains::GetRegistryLength( 414 net::registry_controlled_domains::GetRegistryLength(
414 host, 415 host,
415 net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES, 416 net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
416 net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES); 417 net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
417 if (registry_length == 0 && !db_->IsTypedHost(host)) { 418 if (registry_length == 0 && !db_->IsTypedHost(host)) {
418 stripped_transition = content::PAGE_TRANSITION_TYPED; 419 stripped_transition = content::PAGE_TRANSITION_TYPED;
419 request_transition = 420 request_transition =
(...skipping 2528 matching lines...) Expand 10 before | Expand all | Expand 10 after
2948 int rank = kPageVisitStatsMaxTopSites; 2949 int rank = kPageVisitStatsMaxTopSites;
2949 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);
2950 if (it != most_visited_urls_map_.end()) 2951 if (it != most_visited_urls_map_.end())
2951 rank = (*it).second; 2952 rank = (*it).second;
2952 UMA_HISTOGRAM_ENUMERATION("History.TopSitesVisitsByRank", 2953 UMA_HISTOGRAM_ENUMERATION("History.TopSitesVisitsByRank",
2953 rank, kPageVisitStatsMaxTopSites + 1); 2954 rank, kPageVisitStatsMaxTopSites + 1);
2954 } 2955 }
2955 #endif 2956 #endif
2956 2957
2957 } // namespace history 2958 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698