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

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

Issue 1135693006: Fix X11DesktopHandler::ActivateWindow on Unity for known user gestures Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
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();
}

Powered by Google App Engine
This is Rietveld 408576698