summaryrefslogtreecommitdiffstats
path: root/components/google
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2015-07-16 16:57:33 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-16 23:58:34 +0000
commit955093110ad64d5ec6f5426991efaa4a680b5d6f (patch)
tree19368cdb8861595640715e1072789959729efc2d /components/google
parent387e05a79c7ae346ba7db36977ddfca7ca6f10a3 (diff)
downloadchromium_src-955093110ad64d5ec6f5426991efaa4a680b5d6f.zip
chromium_src-955093110ad64d5ec6f5426991efaa4a680b5d6f.tar.gz
chromium_src-955093110ad64d5ec6f5426991efaa4a680b5d6f.tar.bz2
Remove legacy StartsWithASCII function.
This replaces it with base::StartsWith and the appropriate case flag. Since the existing version only ever did case-insensitive tests in ASCII, there should be no behavior change. BUG=506255 TBR=jam Review URL: https://codereview.chromium.org/1242023005 Cr-Commit-Position: refs/heads/master@{#339175}
Diffstat (limited to 'components/google')
-rw-r--r--components/google/core/browser/google_url_tracker.cc3
-rw-r--r--components/google/core/browser/google_util.cc7
2 files changed, 6 insertions, 4 deletions
diff --git a/components/google/core/browser/google_url_tracker.cc b/components/google/core/browser/google_url_tracker.cc
index 770c9af..2ead364 100644
--- a/components/google/core/browser/google_url_tracker.cc
+++ b/components/google/core/browser/google_url_tracker.cc
@@ -97,7 +97,8 @@ void GoogleURLTracker::OnURLFetchComplete(const net::URLFetcher* source) {
std::string url_str;
source->GetResponseAsString(&url_str);
base::TrimWhitespace(url_str, base::TRIM_ALL, &url_str);
- if (!base::StartsWithASCII(url_str, ".google.", false))
+ if (!base::StartsWith(url_str, ".google.",
+ base::CompareCase::INSENSITIVE_ASCII))
return;
GURL url("https://www" + url_str);
if (!url.is_valid() || (url.path().length() > 1) || url.has_query() ||
diff --git a/components/google/core/browser/google_util.cc b/components/google/core/browser/google_util.cc
index 1eada34..2cdfe05 100644
--- a/components/google/core/browser/google_util.cc
+++ b/components/google/core/browser/google_util.cc
@@ -163,8 +163,8 @@ GURL CommandLineGoogleBaseURL() {
bool StartsWithCommandLineGoogleBaseURL(const GURL& url) {
GURL base_url(CommandLineGoogleBaseURL());
return base_url.is_valid() &&
- base::StartsWithASCII(url.possibly_invalid_spec(), base_url.spec(),
- true);
+ base::StartsWith(url.possibly_invalid_spec(), base_url.spec(),
+ base::CompareCase::SENSITIVE);
}
bool IsGoogleHostname(const std::string& host,
@@ -190,7 +190,8 @@ bool IsGoogleHomePageUrl(const GURL& url) {
// Make sure the path is a known home page path.
std::string path(url.path());
- return IsPathHomePageBase(path) || base::StartsWithASCII(path, "/ig", false);
+ return IsPathHomePageBase(path) ||
+ base::StartsWith(path, "/ig", base::CompareCase::INSENSITIVE_ASCII);
}
bool IsGoogleSearchUrl(const GURL& url) {