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

Side by Side Diff: chrome/browser/prerender/prerender_util.cc

Issue 2478573004: Convert GURL::{host,path} to GURL::{host_piece,path_piece} for ==. (Closed)
Patch Set: rebase to #431874 Created 4 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/prerender/prerender_util.h" 5 #include "chrome/browser/prerender/prerender_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/metrics/sparse_histogram.h" 9 #include "base/metrics/sparse_histogram.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 return base::StartsWith(url.host_piece(), "www.google.", 73 return base::StartsWith(url.host_piece(), "www.google.",
74 base::CompareCase::SENSITIVE); 74 base::CompareCase::SENSITIVE);
75 } 75 }
76 76
77 bool IsGoogleSearchResultURL(const GURL& url) { 77 bool IsGoogleSearchResultURL(const GURL& url) {
78 if (!IsGoogleDomain(url)) 78 if (!IsGoogleDomain(url))
79 return false; 79 return false;
80 return (url.path_piece().empty() || 80 return (url.path_piece().empty() ||
81 base::StartsWith(url.path_piece(), "/search", 81 base::StartsWith(url.path_piece(), "/search",
82 base::CompareCase::SENSITIVE) || 82 base::CompareCase::SENSITIVE) ||
83 (url.path() == "/") || 83 (url.path_piece() == "/") ||
84 base::StartsWith(url.path_piece(), "/webhp", 84 base::StartsWith(url.path_piece(), "/webhp",
85 base::CompareCase::SENSITIVE)); 85 base::CompareCase::SENSITIVE));
86 } 86 }
87 87
88 void ReportPrerenderExternalURL() { 88 void ReportPrerenderExternalURL() {
89 ReportPrerenderSchemeCancelReason( 89 ReportPrerenderSchemeCancelReason(
90 PRERENDER_SCHEME_CANCEL_REASON_EXTERNAL_PROTOCOL); 90 PRERENDER_SCHEME_CANCEL_REASON_EXTERNAL_PROTOCOL);
91 } 91 }
92 92
93 void ReportUnsupportedPrerenderScheme(const GURL& url) { 93 void ReportUnsupportedPrerenderScheme(const GURL& url) {
(...skipping 16 matching lines...) Expand all
110 ReportPrerenderSchemeCancelReason( 110 ReportPrerenderSchemeCancelReason(
111 PRERENDER_SCHEME_CANCEL_REASON_CHROME_EXTENSION); 111 PRERENDER_SCHEME_CANCEL_REASON_CHROME_EXTENSION);
112 } else if (url.SchemeIs("about")) { 112 } else if (url.SchemeIs("about")) {
113 ReportPrerenderSchemeCancelReason(PRERENDER_SCHEME_CANCEL_REASON_ABOUT); 113 ReportPrerenderSchemeCancelReason(PRERENDER_SCHEME_CANCEL_REASON_ABOUT);
114 } else { 114 } else {
115 ReportPrerenderSchemeCancelReason(PRERENDER_SCHEME_CANCEL_REASON_UNKNOWN); 115 ReportPrerenderSchemeCancelReason(PRERENDER_SCHEME_CANCEL_REASON_UNKNOWN);
116 } 116 }
117 } 117 }
118 118
119 } // namespace prerender 119 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/policy/policy_helpers.cc ('k') | chrome/browser/renderer_context_menu/context_menu_content_type_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698