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/docked_panel_collection.h" | 5 #include "chrome/browser/ui/panels/docked_panel_collection.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 | 758 |
759 // Start from the bottom to avoid reshuffling. | 759 // Start from the bottom to avoid reshuffling. |
760 for (Panels::reverse_iterator iter = panels_copy.rbegin(); | 760 for (Panels::reverse_iterator iter = panels_copy.rbegin(); |
761 iter != panels_copy.rend(); ++iter) | 761 iter != panels_copy.rend(); ++iter) |
762 (*iter)->Close(); | 762 (*iter)->Close(); |
763 } | 763 } |
764 | 764 |
765 void DockedPanelCollection::UpdatePanelOnCollectionChange(Panel* panel) { | 765 void DockedPanelCollection::UpdatePanelOnCollectionChange(Panel* panel) { |
766 panel->set_attention_mode(Panel::USE_PANEL_ATTENTION); | 766 panel->set_attention_mode(Panel::USE_PANEL_ATTENTION); |
767 panel->ShowShadow(true); | 767 panel->ShowShadow(true); |
| 768 panel->EnableResizeByMouse(true); |
768 panel->UpdateMinimizeRestoreButtonVisibility(); | 769 panel->UpdateMinimizeRestoreButtonVisibility(); |
769 panel->SetWindowCornerStyle(panel::TOP_ROUNDED); | 770 panel->SetWindowCornerStyle(panel::TOP_ROUNDED); |
770 } | 771 } |
771 | 772 |
772 void DockedPanelCollection::ScheduleLayoutRefresh() { | 773 void DockedPanelCollection::ScheduleLayoutRefresh() { |
773 refresh_action_factory_.InvalidateWeakPtrs(); | 774 refresh_action_factory_.InvalidateWeakPtrs(); |
774 base::MessageLoop::current()->PostDelayedTask( | 775 base::MessageLoop::current()->PostDelayedTask( |
775 FROM_HERE, | 776 FROM_HERE, |
776 base::Bind(&DockedPanelCollection::RefreshLayout, | 777 base::Bind(&DockedPanelCollection::RefreshLayout, |
777 refresh_action_factory_.GetWeakPtr()), | 778 refresh_action_factory_.GetWeakPtr()), |
(...skipping 12 matching lines...) Expand all Loading... |
790 const gfx::Rect& requested_bounds) const { | 791 const gfx::Rect& requested_bounds) const { |
791 gfx::Rect initial_bounds = requested_bounds; | 792 gfx::Rect initial_bounds = requested_bounds; |
792 initial_bounds.set_origin( | 793 initial_bounds.set_origin( |
793 GetDefaultPositionForPanel(requested_bounds.size())); | 794 GetDefaultPositionForPanel(requested_bounds.size())); |
794 return initial_bounds; | 795 return initial_bounds; |
795 } | 796 } |
796 | 797 |
797 bool DockedPanelCollection::HasPanel(Panel* panel) const { | 798 bool DockedPanelCollection::HasPanel(Panel* panel) const { |
798 return find(panels_.begin(), panels_.end(), panel) != panels_.end(); | 799 return find(panels_.begin(), panels_.end(), panel) != panels_.end(); |
799 } | 800 } |
OLD | NEW |