Chromium Code Reviews| Index: chrome/browser/ui/panels/panel_strip.h |
| diff --git a/chrome/browser/ui/panels/panel_strip.h b/chrome/browser/ui/panels/panel_strip.h |
| index a2a8d7680aa3f7e9eed621ae9c9d1a6ae6ff1b1c..29c9610647bcf44104ac9c84eedfd35629cb6329 100644 |
| --- a/chrome/browser/ui/panels/panel_strip.h |
| +++ b/chrome/browser/ui/panels/panel_strip.h |
| @@ -30,7 +30,7 @@ class PanelStrip : public PanelMouseWatcherObserver { |
| // Sets the bounds of the panel strip. |
| // |bounds| is in screen coordinates. |
| - void SetBounds(const gfx::Rect bounds); |
| + void SetDisplayArea(const gfx::Rect area); |
|
jianli
2011/12/01 21:36:28
nit: add "&" after Rect.
jennb
2011/12/01 23:10:17
Done.
|
| // Adds a panel to the strip. The panel may be a newly created panel or one |
| // that is transitioning from another grouping of panels. |
| @@ -112,13 +112,15 @@ class PanelStrip : public PanelMouseWatcherObserver { |
| // Handles all the panels that're delayed to be removed. |
| void DelayedRemove(); |
| - // Does the remove. Called from Remove and DelayedRemove. |
| - void DoRemove(Panel* panel); |
| + // Does the actual remove. Caller is responsible for rearranging |
| + // the panel strip if necessary. |
| + // Returns |false| if panel is not in the strip. |
| + bool DoRemove(Panel* panel); |
| - // Rearranges the positions of the panels starting from the given iterator. |
| + // Rearranges the positions of the panels in the strip. |
| // This is called when the display space has been changed, i.e. working |
| // area being changed or a panel being closed. |
| - void Rearrange(Panels::iterator iter_to_start, int rightmost_position); |
| + void Rearrange(); |
| // Help functions to drag the given panel. |
| void DragLeft(); |
| @@ -132,10 +134,15 @@ class PanelStrip : public PanelMouseWatcherObserver { |
| int GetRightMostAvailablePosition() const; |
| + void MovePanelToOverflow(Panel* panel, bool is_new); |
|
jianli
2011/12/01 21:36:28
Could you please add comment for this, like explai
jennb
2011/12/01 23:10:17
Done.
|
| + |
| + // Adds zero or more panels from overflow as will fit in the panel strip. |
| + void AddPanelsFromOverflow(); |
|
jianli
2011/12/01 21:36:28
How about MovePanelsFromOverflowIfNeeded?
jennb
2011/12/01 23:10:17
Done.
|
| + |
| PanelManager* panel_manager_; // Weak, owns us. |
| // All panels in the panel strip must fit within this area. |
| - gfx::Rect strip_bounds_; |
| + gfx::Rect display_area_; |
| Panels panels_; |
| @@ -165,6 +172,9 @@ class PanelStrip : public PanelMouseWatcherObserver { |
| // Owned by MessageLoop after posting. |
| base::WeakPtrFactory<PanelStrip> titlebar_action_factory_; |
| + // Factory used for moving new panels to overflow after a delay. |
| + base::WeakPtrFactory<PanelStrip> overflow_action_factory_; |
| + |
| static const int kPanelsHorizontalSpacing = 4; |
| // Absolute minimum width and height for panels, including non-client area. |