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 b3f6d43ad20c6f61957fb0dcda16fb95f3ca71a5..a3da7927b31c0ae2b2a771430116234922a98db7 100644 |
--- a/chrome/browser/ui/panels/panel_browser_view.cc |
+++ b/chrome/browser/ui/panels/panel_browser_view.cc |
@@ -303,6 +303,23 @@ bool PanelBrowserView::IsPanelActive() const { |
return IsActive(); |
} |
+void PanelBrowserView::PreventActivationByOS(bool prevent_activation) { |
+ // set the flags "NoActivate" and "AppWindow" to make sure |
jennb
2012/03/01 23:21:28
s/set/Set
|
+ // 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, |
jennb
2012/03/01 23:21:28
Should be indented 2 spaces instead of 4. Continua
|
+ style | WS_EX_NOACTIVATE | WS_EX_APPWINDOW); |
+ else // allow activation |
+ ::SetWindowLong(native_window, GWL_EXSTYLE, |
+ style & ~WS_EX_NOACTIVATE & ~WS_EX_APPWINDOW); |
+ |
+} |
+ |
+ |
gfx::NativeWindow PanelBrowserView::GetNativePanelHandle() { |
return GetNativeHandle(); |
} |