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

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

Issue 2409423005: Compare GURLs to kUrlConstants with .spec() and string equality (Closed)
Patch Set: rebase on dependent patch 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
« no previous file with comments | « chrome/browser/ui/search/new_tab_page_interceptor_service.cc ('k') | chrome/browser/ui/singleton_tabs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/search_tab_helper.cc
diff --git a/chrome/browser/ui/search/search_tab_helper.cc b/chrome/browser/ui/search/search_tab_helper.cc
index 445d160818d85286f98d107430954d9acd866696..f03b427cf95e11b8cfb2760f7671fb79a2981369 100644
--- a/chrome/browser/ui/search/search_tab_helper.cc
+++ b/chrome/browser/ui/search/search_tab_helper.cc
@@ -67,7 +67,7 @@ bool IsNTP(const content::WebContents* contents) {
// whereas we want the visible entry.
const content::NavigationEntry* entry =
contents->GetController().GetVisibleEntry();
- if (entry && entry->GetVirtualURL() == GURL(chrome::kChromeUINewTabURL))
+ if (entry && entry->GetVirtualURL() == chrome::kChromeUINewTabURL)
return true;
return search::IsInstantNTP(contents);
@@ -78,7 +78,7 @@ bool IsLocal(const content::WebContents* contents) {
return false;
const content::NavigationEntry* entry =
contents->GetController().GetVisibleEntry();
- return entry && entry->GetURL() == GURL(chrome::kChromeSearchLocalNtpUrl);
+ return entry && entry->GetURL() == chrome::kChromeSearchLocalNtpUrl;
}
// Returns true if |contents| are rendered inside an Instant process.
@@ -253,7 +253,7 @@ void SearchTabHelper::DidNavigateMainFrame(
content::NavigationEntry* entry =
web_contents_->GetController().GetLastCommittedEntry();
if (entry && entry->GetTitle().empty() &&
- (entry->GetVirtualURL() == GURL(chrome::kChromeUINewTabURL) ||
+ (entry->GetVirtualURL() == chrome::kChromeUINewTabURL ||
search::NavEntryIsInstantNTP(web_contents_, entry))) {
web_contents_->UpdateTitleForEntry(
entry, l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE));
« no previous file with comments | « chrome/browser/ui/search/new_tab_page_interceptor_service.cc ('k') | chrome/browser/ui/singleton_tabs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698