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

Unified Diff: chrome/browser/ui/browser.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sessions/session_common_utils.cc ('k') | chrome/browser/ui/browser_navigator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 29fbcd6c4a9750ba5eda19cdf835f600c4faa324..46bba5782522812e6f11d6a03d064eabafddade4 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1550,12 +1550,12 @@ bool Browser::ShouldFocusLocationBarByDefault(WebContents* source) {
const content::NavigationEntry* entry =
source->GetController().GetActiveEntry();
if (entry) {
- GURL url = entry->GetURL();
- GURL virtual_url = entry->GetVirtualURL();
+ const GURL& url = entry->GetURL();
+ const GURL& virtual_url = entry->GetVirtualURL();
if ((url.SchemeIs(content::kChromeUIScheme) &&
- url.host() == chrome::kChromeUINewTabHost) ||
+ url.host_piece() == chrome::kChromeUINewTabHost) ||
(virtual_url.SchemeIs(content::kChromeUIScheme) &&
- virtual_url.host() == chrome::kChromeUINewTabHost)) {
+ virtual_url.host_piece() == chrome::kChromeUINewTabHost)) {
return true;
}
}
@@ -2057,7 +2057,7 @@ void Browser::OnExtensionUnloaded(
// schemes, e.g. https://mail.google.com if you have the Gmail app
// installed.
if ((web_contents->GetURL().SchemeIs(extensions::kExtensionScheme) &&
- web_contents->GetURL().host() == extension->id()) ||
+ web_contents->GetURL().host_piece() == extension->id()) ||
(extensions::TabHelper::FromWebContents(web_contents)
->extension_app() == extension)) {
tab_strip_model_->CloseWebContentsAt(i, TabStripModel::CLOSE_NONE);
« no previous file with comments | « chrome/browser/sessions/session_common_utils.cc ('k') | chrome/browser/ui/browser_navigator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698