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

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

Issue 2331153002: [Merge to 2840] Fix a bug where inactive windows would inappropriately take focus. (Closed)
Patch Set: Created 4 years, 3 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/browser.h ('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 93b36dce53b8a81872b6653b810a61fcd9689e31..66a501da08598af4e72897714b739ed4868e65dc 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -889,9 +889,11 @@ void Browser::UpdateDownloadShelfVisibility(bool visible) {
///////////////////////////////////////////////////////////////////////////////
-void Browser::UpdateUIForNavigationInTab(WebContents* contents,
- ui::PageTransition transition,
- bool user_initiated) {
+void Browser::UpdateUIForNavigationInTab(
+ WebContents* contents,
+ ui::PageTransition transition,
+ chrome::NavigateParams::WindowAction action,
+ bool user_initiated) {
tab_strip_model_->TabNavigating(contents, transition);
bool contents_is_selected =
@@ -914,8 +916,10 @@ void Browser::UpdateUIForNavigationInTab(WebContents* contents,
// navigating away from the new tab page.
ScheduleUIUpdate(contents, content::INVALIDATE_TYPE_URL);
- if (contents_is_selected)
+ if (contents_is_selected &&
+ (window()->IsActive() || action == chrome::NavigateParams::SHOW_WINDOW)) {
contents->SetInitialFocus();
+ }
}
void Browser::ShowModalSigninWindow(profiles::BubbleViewMode mode,
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_navigator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698