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 // Set the flags "NoActivate" and "AppWindow" to make sure | |
308 // the minimized panels do not get activated by the OS, but | |
309 // do appear in the taskbar and Alt-Tab menu. | |
310 gfx::NativeWindow native_window = GetNativePanelHandle(); | |
311 int style = ::GetWindowLong(native_window, GWL_EXSTYLE); | |
312 | |
313 if (prevent_activation) | |
314 ::SetWindowLong(native_window, GWL_EXSTYLE, | |
315 style | WS_EX_NOACTIVATE | WS_EX_APPWINDOW); | |
316 else // allow activation | |
317 ::SetWindowLong(native_window, GWL_EXSTYLE, | |
318 style & ~WS_EX_NOACTIVATE & ~WS_EX_APPWINDOW); | |
319 | |
320 } | |
321 | |
322 | |
323 gfx::NativeWindow PanelBrowserView::GetNativePanelHandle() { | 306 gfx::NativeWindow PanelBrowserView::GetNativePanelHandle() { |
324 return GetNativeHandle(); | 307 return GetNativeHandle(); |
325 } | 308 } |
326 | 309 |
327 void PanelBrowserView::UpdatePanelTitleBar() { | 310 void PanelBrowserView::UpdatePanelTitleBar() { |
328 UpdateTitleBar(); | 311 UpdateTitleBar(); |
329 } | 312 } |
330 | 313 |
331 void PanelBrowserView::UpdatePanelLoadingAnimations(bool should_animate) { | 314 void PanelBrowserView::UpdatePanelLoadingAnimations(bool should_animate) { |
332 UpdateLoadingAnimations(should_animate); | 315 UpdateLoadingAnimations(should_animate); |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 } | 625 } |
643 | 626 |
644 bool NativePanelTestingWin::IsWindowSizeKnown() const { | 627 bool NativePanelTestingWin::IsWindowSizeKnown() const { |
645 return true; | 628 return true; |
646 } | 629 } |
647 | 630 |
648 bool NativePanelTestingWin::IsAnimatingBounds() const { | 631 bool NativePanelTestingWin::IsAnimatingBounds() const { |
649 return panel_browser_view_->bounds_animator_.get() && | 632 return panel_browser_view_->bounds_animator_.get() && |
650 panel_browser_view_->bounds_animator_->is_animating(); | 633 panel_browser_view_->bounds_animator_->is_animating(); |
651 } | 634 } |
OLD | NEW |