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); | |
769 panel->UpdateMinimizeRestoreButtonVisibility(); | 768 panel->UpdateMinimizeRestoreButtonVisibility(); |
770 panel->SetWindowCornerStyle(panel::TOP_ROUNDED); | 769 panel->SetWindowCornerStyle(panel::TOP_ROUNDED); |
771 } | 770 } |
772 | 771 |
773 void DockedPanelCollection::ScheduleLayoutRefresh() { | 772 void DockedPanelCollection::ScheduleLayoutRefresh() { |
774 refresh_action_factory_.InvalidateWeakPtrs(); | 773 refresh_action_factory_.InvalidateWeakPtrs(); |
775 base::MessageLoop::current()->PostDelayedTask( | 774 base::MessageLoop::current()->PostDelayedTask( |
776 FROM_HERE, | 775 FROM_HERE, |
777 base::Bind(&DockedPanelCollection::RefreshLayout, | 776 base::Bind(&DockedPanelCollection::RefreshLayout, |
778 refresh_action_factory_.GetWeakPtr()), | 777 refresh_action_factory_.GetWeakPtr()), |
(...skipping 12 matching lines...) Expand all Loading... |
791 const gfx::Rect& requested_bounds) const { | 790 const gfx::Rect& requested_bounds) const { |
792 gfx::Rect initial_bounds = requested_bounds; | 791 gfx::Rect initial_bounds = requested_bounds; |
793 initial_bounds.set_origin( | 792 initial_bounds.set_origin( |
794 GetDefaultPositionForPanel(requested_bounds.size())); | 793 GetDefaultPositionForPanel(requested_bounds.size())); |
795 return initial_bounds; | 794 return initial_bounds; |
796 } | 795 } |
797 | 796 |
798 bool DockedPanelCollection::HasPanel(Panel* panel) const { | 797 bool DockedPanelCollection::HasPanel(Panel* panel) const { |
799 return find(panels_.begin(), panels_.end(), panel) != panels_.end(); | 798 return find(panels_.begin(), panels_.end(), panel) != panels_.end(); |
800 } | 799 } |
OLD | NEW |