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

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

Issue 9560002: Cleanup to keep panel from manipulating its panel strip assignment directly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed final nits Created 8 years, 10 months 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/detached_panel_strip.cc ('k') | chrome/browser/ui/panels/docked_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/docked_panel_strip.h
diff --git a/chrome/browser/ui/panels/docked_panel_strip.h b/chrome/browser/ui/panels/docked_panel_strip.h
index 2fb002943a84d77ae1a730dd4bf1c3e73b0a1e1a..89cf565e758141e97571670e2c7f225292a59aff 100644
--- a/chrome/browser/ui/panels/docked_panel_strip.h
+++ b/chrome/browser/ui/panels/docked_panel_strip.h
@@ -43,7 +43,7 @@ class DockedPanelStrip : public PanelStrip,
// Adds a panel to the strip. The panel may be a newly created panel or one
// that is transitioning from another grouping of panels.
virtual void AddPanel(Panel* panel) OVERRIDE;
- virtual bool RemovePanel(Panel* panel) OVERRIDE;
+ virtual void RemovePanel(Panel* panel) OVERRIDE;
virtual void CloseAll() OVERRIDE;
virtual void ResizePanelWindow(
Panel* panel,
@@ -52,6 +52,7 @@ class DockedPanelStrip : public PanelStrip,
virtual void ActivatePanel(Panel* panel) OVERRIDE;
virtual void MinimizePanel(Panel* panel) OVERRIDE;
virtual void RestorePanel(Panel* panel) OVERRIDE;
+ virtual bool IsPanelMinimized(const Panel* panel) const OVERRIDE;
virtual bool CanShowPanelAsActive(const Panel* panel) const OVERRIDE;
virtual bool CanDragPanel(const Panel* panel) const OVERRIDE;
virtual void StartDraggingPanel(Panel* panel) OVERRIDE;
@@ -78,6 +79,7 @@ class DockedPanelStrip : public PanelStrip,
// do NOT have a temporary layout.
int num_panels() const { return panels_.size(); }
const Panels& panels() const { return panels_; }
+ Panel* last_panel() const { return panels_.empty() ? NULL : panels_.back(); }
gfx::Rect display_area() const { return display_area_; }
@@ -91,6 +93,9 @@ class DockedPanelStrip : public PanelStrip,
void OnFullScreenModeChanged(bool is_full_screen);
+ // Returns |true| if panel can fit in the dock strip.
+ bool CanFitPanel(const Panel* panel) const;
+
#ifdef UNIT_TEST
int num_temporary_layout_panels() const {
return panels_in_temporary_layout_.size();
@@ -123,6 +128,12 @@ class DockedPanelStrip : public PanelStrip,
int GetRightMostAvailablePosition() const;
+ // Determines position in strip where a panel of |width| will fit.
+ // Other panels in the strip may be moved to overflow to make room.
+ // Returns x position where a panel of |width| wide can fit.
+ // |width| is in screen coordinates.
+ int FitPanelWithWidth(int width);
+
// Called by AddPanel() after a delay to move a newly created panel from
// the panel strip to overflow because the panel could not fit
// within the bounds of the panel strip. New panels are first displayed
@@ -146,10 +157,6 @@ class DockedPanelStrip : public PanelStrip,
int minimized_panel_count_;
bool are_titlebars_up_;
- // |True| to temporarily prevent refreshing panel layout, e.g. while
- // moving panels to overflow area to make room for a panel in this strip.
- bool disable_layout_refresh_;
-
// Referring to current position in |panels_| where the dragging panel
// resides.
Panels::iterator dragging_panel_current_iterator_;
« no previous file with comments | « chrome/browser/ui/panels/detached_panel_strip.cc ('k') | chrome/browser/ui/panels/docked_panel_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698