OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/panels/panel_browser_view.h" | 5 #include "chrome/browser/ui/panels/panel_browser_view.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "chrome/browser/native_window_notification_source.h" | 9 #include "chrome/browser/native_window_notification_source.h" |
10 #include "chrome/browser/ui/panels/panel.h" | 10 #include "chrome/browser/ui/panels/panel.h" |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 } | 296 } |
297 | 297 |
298 void PanelBrowserView::DeactivatePanel() { | 298 void PanelBrowserView::DeactivatePanel() { |
299 Deactivate(); | 299 Deactivate(); |
300 } | 300 } |
301 | 301 |
302 bool PanelBrowserView::IsPanelActive() const { | 302 bool PanelBrowserView::IsPanelActive() const { |
303 return IsActive(); | 303 return IsActive(); |
304 } | 304 } |
305 | 305 |
| 306 void PanelBrowserView::PreventActivationByOS(bool prevent_activation) { |
| 307 #if defined(OS_WIN) && !defined(USE_AURA) |
| 308 // Set the flags "NoActivate" and "AppWindow" to make sure |
| 309 // the minimized panels do not get activated by the OS, but |
| 310 // do appear in the taskbar and Alt-Tab menu. |
| 311 gfx::NativeWindow native_window = GetNativePanelHandle(); |
| 312 int style = ::GetWindowLong(native_window, GWL_EXSTYLE); |
| 313 |
| 314 if (prevent_activation) |
| 315 ::SetWindowLong(native_window, GWL_EXSTYLE, |
| 316 style | WS_EX_NOACTIVATE | WS_EX_APPWINDOW); |
| 317 else // allow activation |
| 318 ::SetWindowLong(native_window, GWL_EXSTYLE, |
| 319 style & ~WS_EX_NOACTIVATE & ~WS_EX_APPWINDOW); |
| 320 #endif |
| 321 } |
| 322 |
| 323 |
306 gfx::NativeWindow PanelBrowserView::GetNativePanelHandle() { | 324 gfx::NativeWindow PanelBrowserView::GetNativePanelHandle() { |
307 return GetNativeHandle(); | 325 return GetNativeHandle(); |
308 } | 326 } |
309 | 327 |
310 void PanelBrowserView::UpdatePanelTitleBar() { | 328 void PanelBrowserView::UpdatePanelTitleBar() { |
311 UpdateTitleBar(); | 329 UpdateTitleBar(); |
312 } | 330 } |
313 | 331 |
314 void PanelBrowserView::UpdatePanelLoadingAnimations(bool should_animate) { | 332 void PanelBrowserView::UpdatePanelLoadingAnimations(bool should_animate) { |
315 UpdateLoadingAnimations(should_animate); | 333 UpdateLoadingAnimations(should_animate); |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 } | 643 } |
626 | 644 |
627 bool NativePanelTestingWin::IsWindowSizeKnown() const { | 645 bool NativePanelTestingWin::IsWindowSizeKnown() const { |
628 return true; | 646 return true; |
629 } | 647 } |
630 | 648 |
631 bool NativePanelTestingWin::IsAnimatingBounds() const { | 649 bool NativePanelTestingWin::IsAnimatingBounds() const { |
632 return panel_browser_view_->bounds_animator_.get() && | 650 return panel_browser_view_->bounds_animator_.get() && |
633 panel_browser_view_->bounds_animator_->is_animating(); | 651 panel_browser_view_->bounds_animator_->is_animating(); |
634 } | 652 } |
OLD | NEW |