Chromium Code Reviews| 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 | |
|
jennb
2012/03/01 23:21:28
s/set/Set
| |
| 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, | |
|
jennb
2012/03/01 23:21:28
Should be indented 2 spaces instead of 4. Continua
| |
| 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 | |
| 306 gfx::NativeWindow PanelBrowserView::GetNativePanelHandle() { | 323 gfx::NativeWindow PanelBrowserView::GetNativePanelHandle() { |
| 307 return GetNativeHandle(); | 324 return GetNativeHandle(); |
| 308 } | 325 } |
| 309 | 326 |
| 310 void PanelBrowserView::UpdatePanelTitleBar() { | 327 void PanelBrowserView::UpdatePanelTitleBar() { |
| 311 UpdateTitleBar(); | 328 UpdateTitleBar(); |
| 312 } | 329 } |
| 313 | 330 |
| 314 void PanelBrowserView::UpdatePanelLoadingAnimations(bool should_animate) { | 331 void PanelBrowserView::UpdatePanelLoadingAnimations(bool should_animate) { |
| 315 UpdateLoadingAnimations(should_animate); | 332 UpdateLoadingAnimations(should_animate); |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 625 } | 642 } |
| 626 | 643 |
| 627 bool NativePanelTestingWin::IsWindowSizeKnown() const { | 644 bool NativePanelTestingWin::IsWindowSizeKnown() const { |
| 628 return true; | 645 return true; |
| 629 } | 646 } |
| 630 | 647 |
| 631 bool NativePanelTestingWin::IsAnimatingBounds() const { | 648 bool NativePanelTestingWin::IsAnimatingBounds() const { |
| 632 return panel_browser_view_->bounds_animator_.get() && | 649 return panel_browser_view_->bounds_animator_.get() && |
| 633 panel_browser_view_->bounds_animator_->is_animating(); | 650 panel_browser_view_->bounds_animator_->is_animating(); |
| 634 } | 651 } |
| OLD | NEW |