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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 1048473002: Linux/Mac Views: Make BrowserWindow::Show() behave like Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comments, check for Ash Created 5 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bea88d4c5dd496122d36e6e00c880d94a7a244f4..8019f862ea8d1e6643725006860da1fb2b90c6b2 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -684,6 +684,18 @@ void BrowserView::Show() {
frame_->Show();
+#if !defined(OS_WIN)
+ // The Browser associated with this browser window must become the active
+ // browser at the time |Show()| is called. This is the natural behavior under
+ // Windows and Ash, but other platforms will not trigger
+ // OnWidgetActivationChanged() until we return to the runloop. Therefore any
+ // calls to Browser::GetLastActive() will return the wrong result if we do not
+ // explicitly set it here.
+ // A similar block also appears in BrowserWindowCocoa::Show().
+ if (browser()->host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH)
+ BrowserList::SetLastActive(browser());
+#endif
+
force_location_bar_focus_ = false;
browser()->OnWindowDidShow();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698