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

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: Initial patch 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') | chrome/browser/ui/browser_focus_uitest.cc » ('J')
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..c994e3d76974f4125dc936bc9518135b8941a024 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1551,6 +1551,10 @@ void Browser::BeforeUnloadFired(WebContents* web_contents,
}
bool Browser::ShouldFocusLocationBarByDefault(WebContents* source) {
+ // Focus if we're going to the NTP, but only if it's in the active tab.
Peter Kasting 2017/01/12 18:24:04 Nit: This might be clearer as "Navigations in back
Charlie Reis 2017/01/12 19:26:54 Done.
+ if (source != tab_strip_model_->GetActiveWebContents())
+ return false;
Peter Kasting 2017/01/12 18:24:04 Does this mean that, when a user switches to a now
Charlie Reis 2017/01/12 19:26:54 Yes, you're right that there's a secondary bug, an
+
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') | chrome/browser/ui/browser_focus_uitest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698