Chromium Code Reviews| 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 6137a6b4870e90fbaee319c7307b3ec44bfff1b6..99acbf9ebcbd93eca537838ef306cdc7a20f4935 100644 |
| --- a/chrome/browser/ui/panels/panel_manager.cc |
| +++ b/chrome/browser/ui/panels/panel_manager.cc |
| @@ -9,6 +9,7 @@ |
| #include "chrome/browser/ui/browser.h" |
| #include "chrome/browser/ui/browser_list.h" |
| #include "chrome/browser/ui/panels/panel_mouse_watcher.h" |
| +#include "chrome/browser/ui/panels/panel_overflow_strip.h" |
| #include "chrome/browser/ui/panels/panel_strip.h" |
| #include "chrome/browser/ui/window_sizer.h" |
| #include "chrome/common/chrome_notification_types.h" |
| @@ -37,6 +38,7 @@ PanelManager::PanelManager() |
| : panel_mouse_watcher_(PanelMouseWatcher::Create()), |
| auto_sizing_enabled_(true) { |
| panel_strip_.reset(new PanelStrip(this)); |
| + panel_overflow_strip_.reset(new PanelOverflowStrip(this)); |
| auto_hiding_desktop_bar_ = AutoHidingDesktopBar::Create(this); |
| OnDisplayChanged(); |
| } |
| @@ -77,6 +79,10 @@ void PanelManager::Layout() { |
| kPanelStripLeftMargin - kPanelStripRightMargin); |
| panel_strip_bounds.set_height(height); |
| panel_strip_->SetDisplayArea(panel_strip_bounds); |
| + |
| + gfx::Rect overflow_area(adjusted_work_area_); |
|
jennb
2011/12/02 19:15:00
Does overflow strip allow for any margins at the t
jianli
2011/12/02 23:23:46
No per the mocks.
|
| + overflow_area.set_width(kOverflowStripThickness); |
| + panel_overflow_strip_->SetDisplayArea(overflow_area); |
| } |
| Panel* PanelManager::CreatePanel(Browser* browser) { |
| @@ -100,7 +106,7 @@ int PanelManager::StartingRightPosition() const { |
| void PanelManager::Remove(Panel* panel) { |
| if (panel_strip_->Remove(panel)) |
| return; |
| - // TODO(jianli): else try removing from overflow strip |
| + panel_overflow_strip_->Remove(panel); |
|
jennb
2011/12/02 21:16:58
nit: DCHECK this returns true?
jianli
2011/12/02 23:23:46
Done.
|
| } |
| void PanelManager::OnPanelRemoved(Panel* panel) { |
| @@ -123,8 +129,11 @@ void PanelManager::EndDragging(bool cancelled) { |
| } |
| void PanelManager::OnPanelExpansionStateChanged( |
| - Panel::ExpansionState old_state, Panel::ExpansionState new_state) { |
| - panel_strip_->OnPanelExpansionStateChanged(old_state, new_state); |
| + Panel* panel, Panel::ExpansionState old_state) { |
| + if (panel->expansion_state() == Panel::IN_OVERFLOW) |
| + panel_overflow_strip_->OnPanelExpansionStateChanged(panel, old_state); |
| + else |
| + panel_strip_->OnPanelExpansionStateChanged(panel, old_state); |
| } |
| void PanelManager::OnPreferredWindowSizeChanged( |
| @@ -159,11 +168,6 @@ void PanelManager::AdjustWorkAreaForAutoHidingDesktopBars() { |
| } |
| } |
| -int PanelManager::GetBottomPositionForExpansionState( |
| - Panel::ExpansionState expansion_state) const { |
| - return panel_strip_->GetBottomPositionForExpansionState(expansion_state); |
| -} |
| - |
| BrowserWindow* PanelManager::GetNextBrowserWindowToActivate( |
| Panel* panel) const { |
| // Find the last active browser window that is not minimized. |
| @@ -178,10 +182,6 @@ BrowserWindow* PanelManager::GetNextBrowserWindowToActivate( |
| return NULL; |
| } |
| -void PanelManager::MoveToOverflowStrip(Panel* panel, bool is_new) { |
| - // TODO(jianli) - implement. |
| -} |
| - |
| void PanelManager::OnAutoHidingDesktopBarThicknessChanged() { |
| AdjustWorkAreaForAutoHidingDesktopBars(); |
| Layout(); |
| @@ -195,12 +195,11 @@ void PanelManager::OnAutoHidingDesktopBarVisibilityChanged( |
| void PanelManager::RemoveAll() { |
| panel_strip_->RemoveAll(); |
| - // TODO(jianli): overflow_strip_->RemoveAll(); |
| + panel_overflow_strip_->RemoveAll(); |
| } |
| int PanelManager::num_panels() const { |
| - return panel_strip_->num_panels(); |
| - // TODO(jianli): + overflow_strip_->num_panels(); |
| + return panel_strip_->num_panels()+ panel_overflow_strip_->num_panels(); |
|
jennb
2011/12/02 19:15:00
space before +
jianli
2011/12/02 23:23:46
Done.
|
| } |
| bool PanelManager::is_dragging_panel() const { |