Index: chrome/browser/ui/views/frame/browser_view.cc |
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc |
index 8bdf6ad6ac0a08d454073024920ef2ae39d4f305..09c183d1fb227d2eb52157ca2066ff5ef4f16f0a 100644 |
--- a/chrome/browser/ui/views/frame/browser_view.cc |
+++ b/chrome/browser/ui/views/frame/browser_view.cc |
@@ -852,6 +852,11 @@ LocationBar* BrowserView::GetLocationBar() const { |
} |
void BrowserView::SetFocusToLocationBar(bool select_all) { |
+ // Only change focus if this is the active window otherwise we'll end |
+ // accidentally deactivating another window. |
+ if (!IsActive()) |
+ return; |
+ |
if (UseCompactNavigationBar()) { |
// If focus ever goes to the location bar, we should make sure it is shown |
// in compact mode. This includes all accelerators that move focus there. |