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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 | 637 |
638 DoBringUpOrDownTitlebars(delayed_titlebar_action_ == BRING_UP); | 638 DoBringUpOrDownTitlebars(delayed_titlebar_action_ == BRING_UP); |
639 delayed_titlebar_action_ = NO_ACTION; | 639 delayed_titlebar_action_ = NO_ACTION; |
640 } | 640 } |
641 | 641 |
642 void DockedPanelCollection::OnAutoHidingDesktopBarThicknessChanged( | 642 void DockedPanelCollection::OnAutoHidingDesktopBarThicknessChanged( |
643 DisplaySettingsProvider::DesktopBarAlignment alignment, int thickness) { | 643 DisplaySettingsProvider::DesktopBarAlignment alignment, int thickness) { |
644 RefreshLayout(); | 644 RefreshLayout(); |
645 } | 645 } |
646 | 646 |
647 void DockedPanelCollection::OnFullScreenModeChanged(bool is_full_screen) { | |
648 for (Panels::const_iterator iter = panels_.begin(); | |
649 iter != panels_.end(); ++iter) { | |
650 (*iter)->FullScreenModeChanged(is_full_screen); | |
651 } | |
652 } | |
653 | |
654 void DockedPanelCollection::RefreshLayout() { | 647 void DockedPanelCollection::RefreshLayout() { |
655 int total_active_width = 0; | 648 int total_active_width = 0; |
656 int total_inactive_width = 0; | 649 int total_inactive_width = 0; |
657 | 650 |
658 for (Panels::const_iterator panel_iter = panels_.begin(); | 651 for (Panels::const_iterator panel_iter = panels_.begin(); |
659 panel_iter != panels_.end(); ++panel_iter) { | 652 panel_iter != panels_.end(); ++panel_iter) { |
660 Panel* panel = *panel_iter; | 653 Panel* panel = *panel_iter; |
661 if (panel->IsActive()) | 654 if (panel->IsActive()) |
662 total_active_width += panel->full_size().width(); | 655 total_active_width += panel->full_size().width(); |
663 else | 656 else |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 void DockedPanelCollection::OnPanelActiveStateChanged(Panel* panel) { | 778 void DockedPanelCollection::OnPanelActiveStateChanged(Panel* panel) { |
786 // Refresh layout, but wait till active states settle. | 779 // Refresh layout, but wait till active states settle. |
787 // This lets us avoid refreshing too many times when one panel loses | 780 // This lets us avoid refreshing too many times when one panel loses |
788 // focus and another gains it. | 781 // focus and another gains it. |
789 ScheduleLayoutRefresh(); | 782 ScheduleLayoutRefresh(); |
790 } | 783 } |
791 | 784 |
792 bool DockedPanelCollection::HasPanel(Panel* panel) const { | 785 bool DockedPanelCollection::HasPanel(Panel* panel) const { |
793 return find(panels_.begin(), panels_.end(), panel) != panels_.end(); | 786 return find(panels_.begin(), panels_.end(), panel) != panels_.end(); |
794 } | 787 } |
OLD | NEW |