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 89365884465f36be36c9ddc76ca99de2d07da536..5b51c9d900d418733e9ab39d0bfc5950525e5801 100644 |
--- a/chrome/browser/ui/views/frame/browser_view.cc |
+++ b/chrome/browser/ui/views/frame/browser_view.cc |
@@ -664,7 +664,7 @@ void BrowserView::Show() { |
// 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. |
+ // explicitly set it here and in ShowForUserGesture(). |
// A similar block also appears in BrowserWindowCocoa::Show(). |
if (browser()->host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH) |
BrowserList::SetLastActive(browser()); |
@@ -703,6 +703,22 @@ void BrowserView::Show() { |
chrome::MaybeShowInvertBubbleView(this); |
} |
+void BrowserView::ShowForUserGesture() { |
+ if (!frame_->IsVisible()) { |
+ Show(); |
+ return; |
+ } |
+ |
+#if !defined(OS_WIN) |
+ // See comment in Show(). |
+ if (browser()->host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH) |
+ BrowserList::SetLastActive(browser()); |
+#endif |
+ |
+ // Since the window is already visible, just activate it. |
+ frame_->ActivateForUserGesture(); |
+} |
+ |
void BrowserView::ShowInactive() { |
if (!frame_->IsVisible()) |
frame_->ShowInactive(); |
@@ -725,6 +741,10 @@ void BrowserView::Activate() { |
frame_->Activate(); |
} |
+void BrowserView::ActivateForUserGesture() { |
+ frame_->ActivateForUserGesture(); |
+} |
+ |
void BrowserView::Deactivate() { |
frame_->Deactivate(); |
} |