| 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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 mouse_pressed_ = false; | 535 mouse_pressed_ = false; |
| 536 | 536 |
| 537 mouse_dragging_state_ = DRAGGING_ENDED; | 537 mouse_dragging_state_ = DRAGGING_ENDED; |
| 538 panel_->manager()->EndDragging(cancelled); | 538 panel_->manager()->EndDragging(cancelled); |
| 539 return true; | 539 return true; |
| 540 } | 540 } |
| 541 | 541 |
| 542 void PanelBrowserView::SetPanelAppIconVisibility(bool visible) { | 542 void PanelBrowserView::SetPanelAppIconVisibility(bool visible) { |
| 543 #if defined(OS_WIN) && !defined(USE_AURA) | 543 #if defined(OS_WIN) && !defined(USE_AURA) |
| 544 gfx::NativeWindow native_window = GetNativeHandle(); | 544 gfx::NativeWindow native_window = GetNativeHandle(); |
| 545 ::ShowWindow(native_window, SW_HIDE); | |
| 546 int style = ::GetWindowLong(native_window, GWL_EXSTYLE); | 545 int style = ::GetWindowLong(native_window, GWL_EXSTYLE); |
| 546 int new_style = style; |
| 547 if (visible) | 547 if (visible) |
| 548 style &= (~WS_EX_TOOLWINDOW); | 548 new_style &= (~WS_EX_TOOLWINDOW); |
| 549 else | 549 else |
| 550 style |= WS_EX_TOOLWINDOW; | 550 new_style |= WS_EX_TOOLWINDOW; |
| 551 ::SetWindowLong(native_window, GWL_EXSTYLE, style); | 551 if (style != new_style) { |
| 552 ::ShowWindow(native_window, SW_SHOWNA); | 552 ::ShowWindow(native_window, SW_HIDE); |
| 553 ::SetWindowLong(native_window, GWL_EXSTYLE, new_style); |
| 554 ::ShowWindow(native_window, SW_SHOWNA); |
| 555 } |
| 553 #else | 556 #else |
| 554 NOTIMPLEMENTED(); | 557 NOTIMPLEMENTED(); |
| 555 #endif | 558 #endif |
| 556 } | 559 } |
| 557 | 560 |
| 561 void PanelBrowserView::SetPanelAlwaysOnTop(bool on_top) { |
| 562 GetWidget()->SetAlwaysOnTop(on_top); |
| 563 } |
| 564 |
| 558 // NativePanelTesting implementation. | 565 // NativePanelTesting implementation. |
| 559 class NativePanelTestingWin : public NativePanelTesting { | 566 class NativePanelTestingWin : public NativePanelTesting { |
| 560 public: | 567 public: |
| 561 explicit NativePanelTestingWin(PanelBrowserView* panel_browser_view); | 568 explicit NativePanelTestingWin(PanelBrowserView* panel_browser_view); |
| 562 | 569 |
| 563 private: | 570 private: |
| 564 virtual void PressLeftMouseButtonTitlebar( | 571 virtual void PressLeftMouseButtonTitlebar( |
| 565 const gfx::Point& mouse_location) OVERRIDE; | 572 const gfx::Point& mouse_location) OVERRIDE; |
| 566 virtual void ReleaseMouseButtonTitlebar() OVERRIDE; | 573 virtual void ReleaseMouseButtonTitlebar() OVERRIDE; |
| 567 virtual void DragTitlebar(const gfx::Point& mouse_location) OVERRIDE; | 574 virtual void DragTitlebar(const gfx::Point& mouse_location) OVERRIDE; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 } | 637 } |
| 631 | 638 |
| 632 bool NativePanelTestingWin::IsWindowSizeKnown() const { | 639 bool NativePanelTestingWin::IsWindowSizeKnown() const { |
| 633 return true; | 640 return true; |
| 634 } | 641 } |
| 635 | 642 |
| 636 bool NativePanelTestingWin::IsAnimatingBounds() const { | 643 bool NativePanelTestingWin::IsAnimatingBounds() const { |
| 637 return panel_browser_view_->bounds_animator_.get() && | 644 return panel_browser_view_->bounds_animator_.get() && |
| 638 panel_browser_view_->bounds_animator_->is_animating(); | 645 panel_browser_view_->bounds_animator_->is_animating(); |
| 639 } | 646 } |
| OLD | NEW |