Index: chrome/browser/ui/panels/panel_manager.cc |
diff --git a/chrome/browser/ui/panels/panel_manager.cc b/chrome/browser/ui/panels/panel_manager.cc |
index b7669b3d4f05e7406ad9799f97d8a08ce83b648d..3d914b9ed3f01563bb6033af391c6956507b705b 100644 |
--- a/chrome/browser/ui/panels/panel_manager.cc |
+++ b/chrome/browser/ui/panels/panel_manager.cc |
@@ -328,6 +328,7 @@ void PanelManager::OnPanelExpansionStateChanged( |
DecrementMinimizedPanels(); |
break; |
case Panel::MINIMIZED: |
+ case Panel::TITLE_ONLY: |
if (old_state == Panel::EXPANDED) |
IncrementMinimizedPanels(); |
break; |
@@ -524,11 +525,6 @@ void PanelManager::AdjustWorkAreaForAutoHidingDesktopBars() { |
// Note that we do not care about the desktop bar aligned to the top edge |
// since panels could not reach so high due to size constraint. |
adjusted_work_area_ = work_area_; |
- if (auto_hiding_desktop_bar_->IsEnabled(AutoHidingDesktopBar::ALIGN_BOTTOM)) { |
- int space = auto_hiding_desktop_bar_->GetThickness( |
- AutoHidingDesktopBar::ALIGN_BOTTOM); |
- adjusted_work_area_.set_height(adjusted_work_area_.height() - space); |
- } |
if (auto_hiding_desktop_bar_->IsEnabled(AutoHidingDesktopBar::ALIGN_LEFT)) { |
int space = auto_hiding_desktop_bar_->GetThickness( |
AutoHidingDesktopBar::ALIGN_LEFT); |
@@ -546,10 +542,10 @@ int PanelManager::GetBottomPositionForExpansionState( |
Panel::ExpansionState expansion_state) const { |
int bottom = adjusted_work_area_.bottom(); |
// If there is an auto-hiding desktop bar aligned to the bottom edge, we need |
- // to move the minimize panel down to the bottom edge. |
- if (expansion_state == Panel::MINIMIZED && |
+ // to move the title-only panel above the auto-hiding desktop bar. |
+ if (expansion_state == Panel::TITLE_ONLY && |
auto_hiding_desktop_bar_->IsEnabled(AutoHidingDesktopBar::ALIGN_BOTTOM)) { |
- bottom += auto_hiding_desktop_bar_->GetThickness( |
+ bottom -= auto_hiding_desktop_bar_->GetThickness( |
AutoHidingDesktopBar::ALIGN_BOTTOM); |
} |
@@ -603,7 +599,9 @@ void PanelManager::Rearrange(Panels::iterator iter_to_start, |
Panel* panel = *iter; |
gfx::Rect new_bounds(panel->GetBounds()); |
new_bounds.set_x(rightmost_position - new_bounds.width()); |
- new_bounds.set_y(adjusted_work_area_.bottom() - new_bounds.height()); |
+ new_bounds.set_y( |
+ GetBottomPositionForExpansionState(panel->expansion_state()) - |
+ new_bounds.height()); |
if (new_bounds != panel->GetBounds()) |
panel->SetPanelBounds(new_bounds); |