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

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

Issue 2624373002: Don't focus the location bar for NTP navigations in non-selected tabs. (Closed)
Patch Set: Fix nits Created 3 years, 11 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 | « no previous file | chrome/browser/ui/browser_focus_uitest.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 b64ad9188e41876adfbc062c9ba58453894c622b..db53835595470c6b7163ac43d6556b9eab517852 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1551,6 +1551,11 @@ void Browser::BeforeUnloadFired(WebContents* web_contents,
}
bool Browser::ShouldFocusLocationBarByDefault(WebContents* source) {
+ // Navigations in background tabs shouldn't change the focus state of the
+ // omnibox, since it's associated with the foreground tab.
+ if (source != tab_strip_model_->GetActiveWebContents())
+ return false;
+
const content::NavigationEntry* entry =
source->GetController().GetActiveEntry();
if (entry) {
« no previous file with comments | « no previous file | chrome/browser/ui/browser_focus_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698