| 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/display_settings_provider.h" | 10 #include "chrome/browser/ui/panels/display_settings_provider.h" |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 // Only handle clicks that started in our window. | 506 // Only handle clicks that started in our window. |
| 507 if (!mouse_pressed_) | 507 if (!mouse_pressed_) |
| 508 return false; | 508 return false; |
| 509 mouse_pressed_ = false; | 509 mouse_pressed_ = false; |
| 510 | 510 |
| 511 mouse_dragging_state_ = DRAGGING_ENDED; | 511 mouse_dragging_state_ = DRAGGING_ENDED; |
| 512 panel_->manager()->EndDragging(cancelled); | 512 panel_->manager()->EndDragging(cancelled); |
| 513 return true; | 513 return true; |
| 514 } | 514 } |
| 515 | 515 |
| 516 void PanelBrowserView::SetPanelAppIconVisibility(bool visible) { | |
| 517 #if defined(OS_WIN) && !defined(USE_AURA) | |
| 518 gfx::NativeWindow native_window = GetNativeHandle(); | |
| 519 int style = ::GetWindowLong(native_window, GWL_EXSTYLE); | |
| 520 int new_style = style; | |
| 521 if (visible) | |
| 522 new_style &= (~WS_EX_TOOLWINDOW); | |
| 523 else | |
| 524 new_style |= WS_EX_TOOLWINDOW; | |
| 525 if (style != new_style) { | |
| 526 ::ShowWindow(native_window, SW_HIDE); | |
| 527 ::SetWindowLong(native_window, GWL_EXSTYLE, new_style); | |
| 528 ::ShowWindow(native_window, SW_SHOWNA); | |
| 529 } | |
| 530 #else | |
| 531 NOTIMPLEMENTED(); | |
| 532 #endif | |
| 533 } | |
| 534 | |
| 535 void PanelBrowserView::SetPanelAlwaysOnTop(bool on_top) { | 516 void PanelBrowserView::SetPanelAlwaysOnTop(bool on_top) { |
| 536 GetWidget()->SetAlwaysOnTop(on_top); | 517 GetWidget()->SetAlwaysOnTop(on_top); |
| 537 GetWidget()->non_client_view()->Layout(); | 518 GetWidget()->non_client_view()->Layout(); |
| 538 GetWidget()->client_view()->Layout(); | 519 GetWidget()->client_view()->Layout(); |
| 539 } | 520 } |
| 540 | 521 |
| 541 bool PanelBrowserView::IsAnimatingBounds() const { | 522 bool PanelBrowserView::IsAnimatingBounds() const { |
| 542 return bounds_animator_.get() && bounds_animator_->is_animating(); | 523 return bounds_animator_.get() && bounds_animator_->is_animating(); |
| 543 } | 524 } |
| 544 | 525 |
| 545 void PanelBrowserView::EnableResizeByMouse(bool enable) { | 526 void PanelBrowserView::EnableResizeByMouse(bool enable) { |
| 546 } | 527 } |
| 547 | 528 |
| 529 void PanelBrowserView::UpdatePanelMinimizeRestoreButtonVisibility() { |
| 530 GetFrameView()->UpdateTitleBarMinimizeRestoreButtonVisibility(); |
| 531 } |
| 532 |
| 533 |
| 548 #if defined(OS_WIN) && !defined(USE_AURA) | 534 #if defined(OS_WIN) && !defined(USE_AURA) |
| 549 void PanelBrowserView::UpdateWindowAttribute(int attribute_index, | 535 void PanelBrowserView::UpdateWindowAttribute(int attribute_index, |
| 550 int attribute_value, | 536 int attribute_value, |
| 551 bool to_set) { | 537 bool to_set) { |
| 552 gfx::NativeWindow native_window = GetNativePanelHandle(); | 538 gfx::NativeWindow native_window = GetNativePanelHandle(); |
| 553 int value = ::GetWindowLong(native_window, attribute_index); | 539 int value = ::GetWindowLong(native_window, attribute_index); |
| 554 int expected_value; | 540 int expected_value; |
| 555 if (to_set) | 541 if (to_set) |
| 556 expected_value = value | attribute_value; | 542 expected_value = value | attribute_value; |
| 557 else | 543 else |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 return frame_view->close_button_->visible(); | 641 return frame_view->close_button_->visible(); |
| 656 case MINIMIZE_BUTTON: | 642 case MINIMIZE_BUTTON: |
| 657 return frame_view->minimize_button_->visible(); | 643 return frame_view->minimize_button_->visible(); |
| 658 case RESTORE_BUTTON: | 644 case RESTORE_BUTTON: |
| 659 return frame_view->restore_button_->visible(); | 645 return frame_view->restore_button_->visible(); |
| 660 default: | 646 default: |
| 661 NOTREACHED(); | 647 NOTREACHED(); |
| 662 } | 648 } |
| 663 return false; | 649 return false; |
| 664 } | 650 } |
| OLD | NEW |