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

Unified Diff: chrome/browser/search/search.cc

Issue 2409423005: Compare GURLs to kUrlConstants with .spec() and string equality (Closed)
Patch Set: git cl format Created 4 years, 2 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/search/search.cc
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
index 98336e62686dfd958dba0aa028ebd3ad0cda95dc..7641cf7e505fef208549ab4545ed36bdd337265d 100644
--- a/chrome/browser/search/search.cc
+++ b/chrome/browser/search/search.cc
@@ -299,12 +299,11 @@ bool IsNTPURL(const GURL& url, Profile* profile) {
return false;
if (!IsInstantExtendedAPIEnabled())
- return url == GURL(chrome::kChromeUINewTabURL);
+ return url.spec() == chrome::kChromeUINewTabURL;
const base::string16 search_terms = ExtractSearchTermsFromURL(profile, url);
- return profile &&
- ((IsInstantURL(url, profile) && search_terms.empty()) ||
- url == GURL(chrome::kChromeSearchLocalNtpUrl));
+ return profile && ((IsInstantURL(url, profile) && search_terms.empty()) ||
+ url.spec() == chrome::kChromeSearchLocalNtpUrl);
}
bool IsInstantNTP(const content::WebContents* contents) {
@@ -331,7 +330,7 @@ bool IsInstantNTPURL(const GURL& url, Profile* profile) {
if (!IsInstantExtendedAPIEnabled())
return false;
- if (url == GURL(chrome::kChromeSearchLocalNtpUrl))
+ if (url.spec() == chrome::kChromeSearchLocalNtpUrl)
return true;
GURL new_tab_url(GetNewTabPageURL(profile));

Powered by Google App Engine
This is Rietveld 408576698