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..12467a30e9a149a6fb9f176ae506c57fe6f897b3 100644 |
--- a/chrome/browser/ui/panels/docked_panel_strip.h |
+++ b/chrome/browser/ui/panels/docked_panel_strip.h |
@@ -53,10 +53,17 @@ class DockedPanelStrip : public PanelStrip, |
virtual void MinimizePanel(Panel* panel) OVERRIDE; |
virtual void RestorePanel(Panel* panel) OVERRIDE; |
virtual bool CanShowPanelAsActive(const Panel* panel) const OVERRIDE; |
+ virtual void SavePanelPlacement(Panel* panel) OVERRIDE; |
+ virtual void LoadSavedPanelPlacement() OVERRIDE; |
+ virtual void DiscardSavedPanelPlacement() OVERRIDE; |
virtual bool CanDragPanel(const Panel* panel) const OVERRIDE; |
- virtual void StartDraggingPanel(Panel* panel) OVERRIDE; |
- virtual void DragPanel(Panel* panel, int delta_x, int delta_y) OVERRIDE; |
- virtual void EndDraggingPanel(Panel* panel, bool cancelled) OVERRIDE; |
+ virtual void StartDraggingPanelLocally(Panel* panel) OVERRIDE; |
+ virtual void DragPanelLocally(Panel* panel, |
+ int delta_x, |
+ int delta_y) OVERRIDE; |
+ virtual void EndDraggingPanelLocally(Panel* panel, bool cancelled) OVERRIDE; |
+ virtual void AddDraggingPanel(Panel* panel, |
+ const gfx::Point& position) OVERRIDE; |
// Invoked when a panel's expansion state changes. |
void OnPanelExpansionStateChanged(Panel* panel); |
@@ -104,9 +111,27 @@ class DockedPanelStrip : public PanelStrip, |
BRING_DOWN |
}; |
+ struct PanelPlacement { |
+ Panel* panel; |
+ // When |panel| is restored, it will be bring back before |
jennb
2012/03/03 02:19:33
The wording here is confusing to me. How about:
R
jianli
2012/03/07 19:14:31
Done.
|
+ // |panel_to_place_before_|. |
+ Panel* panel_to_place_before_; |
+ |
+ PanelPlacement() : panel(NULL) { } |
+ }; |
+ |
// Overridden from PanelMouseWatcherObserver: |
virtual void OnMouseMove(const gfx::Point& mouse_position) OVERRIDE; |
+ // Inserts |panel| to the collection at |position|. |
+ // Returns the iterator that points to the newly inserted panel. |
+ void InsertPanelToCollection(Panel* panel, Panels::iterator position); |
jennb
2012/03/03 02:19:33
Doesn't return anything. This sounds like a wrappe
jianli
2012/03/07 19:14:31
Removed. We now don't need a wrapper. Instead, I i
|
+ |
+ // Ensures that there is sufficient space in the strip to add a panel with |
+ // the specified width. We might need to bump panels in the strip to make |
+ // room for this panel. |
+ void EnsureAvailableSpace(int width); |
+ |
// Keep track of the minimized panels to control mouse watching. |
void IncrementMinimizedPanels(); |
void DecrementMinimizedPanels(); |
@@ -154,10 +179,6 @@ class DockedPanelStrip : public PanelStrip, |
// resides. |
Panels::iterator dragging_panel_current_iterator_; |
- // Referring to original position in |panels_| where the dragging panel |
- // resides. |
- Panels::iterator dragging_panel_original_iterator_; |
- |
// Delayed transitions support. Sometimes transitions between minimized and |
// title-only states are delayed, for better usability with Taskbars/Docks. |
TitlebarAction delayed_titlebar_action_; |
@@ -165,6 +186,9 @@ class DockedPanelStrip : public PanelStrip, |
// Owned by MessageLoop after posting. |
base::WeakPtrFactory<DockedPanelStrip> titlebar_action_factory_; |
+ // Used to save the placement information for a panel. |
+ PanelPlacement saved_panel_placement_; |
+ |
static const int kPanelsHorizontalSpacing = 4; |
// Absolute minimum width and height for panels, including non-client area. |