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

Unified Diff: chrome/browser/ui/panels/panel_browser_view.cc

Issue 9463022: Minimized panels should not open on Windows when activated by the OS (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: removed unnecessary include Created 8 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
Index: chrome/browser/ui/panels/panel_browser_view.cc
diff --git a/chrome/browser/ui/panels/panel_browser_view.cc b/chrome/browser/ui/panels/panel_browser_view.cc
index 9873a24b7b06df08190efd61f66d09695053000d..7f7676580f6e0acdbb030deeb44ff54221a9400a 100644
--- a/chrome/browser/ui/panels/panel_browser_view.cc
+++ b/chrome/browser/ui/panels/panel_browser_view.cc
@@ -303,6 +303,24 @@ bool PanelBrowserView::IsPanelActive() const {
return IsActive();
}
+void PanelBrowserView::PreventActivationByOS(bool prevent_activation) {
+#if defined(OS_WIN) && !defined(USE_AURA)
+ // Set the flags "NoActivate" and "AppWindow" to make sure
+ // the minimized panels do not get activated by the OS, but
+ // do appear in the taskbar and Alt-Tab menu.
+ gfx::NativeWindow native_window = GetNativePanelHandle();
+ int style = ::GetWindowLong(native_window, GWL_EXSTYLE);
+
+ if (prevent_activation)
+ ::SetWindowLong(native_window, GWL_EXSTYLE,
+ style | WS_EX_NOACTIVATE | WS_EX_APPWINDOW);
+ else // allow activation
+ ::SetWindowLong(native_window, GWL_EXSTYLE,
+ style & ~WS_EX_NOACTIVATE & ~WS_EX_APPWINDOW);
+#endif
+}
+
+
gfx::NativeWindow PanelBrowserView::GetNativePanelHandle() {
return GetNativeHandle();
}
« no previous file with comments | « chrome/browser/ui/panels/panel_browser_view.h ('k') | chrome/browser/ui/panels/panel_browser_window_cocoa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698