Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: chrome/browser/ui/panels/panel_strip.h

Issue 8774013: Add panel overflow logic to panel strip. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo, remove dummy code Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/panels/panel_manager.cc ('k') | chrome/browser/ui/panels/panel_strip.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ca35100a141c323e63d227e72cebe5435e00ed10 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);
// 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,16 @@ 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.
+ // Handles moving panels to/from overflow area as needed.
// 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 +135,24 @@ class PanelStrip : public PanelMouseWatcherObserver {
int GetRightMostAvailablePosition() const;
+ // Moves the panel from the panel strip to the overflow area because
+ // the panel will not fit within the bounds of the panel strip.
+ // Overflow may occur when new panels are added, the bounds of the strip
+ // changes, a panel's size grows, a panel is moved from overflow into
+ // the strip, etc.
+ void MovePanelToOverflow(Panel* panel, bool is_new);
+
+ // Moves panels to the overflow area, starting from the last panel.
+ // |overflow_point| is the index of the first panel to oveflow.
+ void MovePanelsToOverflow(size_t overflow_point);
+
+ // Adds zero or more panels from overflow as will fit in the panel strip.
+ void MovePanelsFromOverflowIfNeeded();
+
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 +182,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.
« no previous file with comments | « chrome/browser/ui/panels/panel_manager.cc ('k') | chrome/browser/ui/panels/panel_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698