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

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: 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..37841e32dea16d6f9626fdbab6bd86fdc09e37a9 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();
+ // A similar block also appears in BrowserWindowCocoa::Show().
Peter Kasting 2015/03/28 02:35:38 Nit: I would replace the last sentence of the comm
+#if !defined(OS_WIN)
tapted 2015/03/28 03:10:57 add `&& !defined(OS_CHROMEOS)`? The downside of n
Peter Kasting 2015/03/28 03:12:52 Hmm, is OS_CHROMEOS right then? It sounds like th
tapted 2015/03/28 03:35:31 Yeah - it would be a complexity/correctness tradeo
+ // 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, but Linux Views 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.
+ // Mac Views will likely have the same problem, so do this for Mac as well.
tapted 2015/03/28 03:10:56 yup - activation on Mac is always asynchronous.
+ 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