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

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: Move to the top of BrowserView::Show() 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..b55fa660940079c5d18ecb270c5fd90ae6333e0a 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -658,6 +658,18 @@ gfx::ImageSkia BrowserView::GetOTRAvatarIcon() const {
// BrowserView, BrowserWindow implementation:
void BrowserView::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
+
// If the window is already visible, just activate it.
if (frame_->IsVisible()) {
frame_->Activate();
« 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