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

Unified Diff: chrome/browser/ui/browser_navigator_browsertest.cc

Issue 2121513002: Replace string::find(prefix) == 0 pattern with base::StartsWith(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typos Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/browser_navigator_browsertest.cc
diff --git a/chrome/browser/ui/browser_navigator_browsertest.cc b/chrome/browser/ui/browser_navigator_browsertest.cc
index 4c8c1d98b578c3dee46e667bbfe633f54491a1fd..efae8f10f1bc73365fd7528efb12e56b488a7aa8 100644
--- a/chrome/browser/ui/browser_navigator_browsertest.cc
+++ b/chrome/browser/ui/browser_navigator_browsertest.cc
@@ -68,7 +68,7 @@ GURL ShortenUberURL(const GURL& url) {
std::string url_string = url.spec();
const std::string long_prefix = "chrome://chrome/";
const std::string short_prefix = "chrome://";
- if (url_string.find(long_prefix) != 0)
+ if (!base::StartsWith(url_string, long_prefix, base::CompareCase::SENSITIVE))
return url;
url_string.replace(0, long_prefix.length(), short_prefix);
return GURL(url_string);

Powered by Google App Engine
This is Rietveld 408576698