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 7b0bced6fc2a6b29013fbc85f8db791ffa6d87dd..290c7a23bcb4cee9a9fdea882cc49a5b139bdd48 100644 |
| --- a/chrome/browser/ui/panels/panel_strip.h |
| +++ b/chrome/browser/ui/panels/panel_strip.h |
| @@ -6,6 +6,7 @@ |
| #define CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_ |
| #pragma once |
| +#include "ui/gfx/point.h" |
| #include "ui/gfx/rect.h" |
| class Panel; |
| @@ -65,15 +66,34 @@ class PanelStrip { |
| // Returns true if |panel| can be shown as active. |
| virtual bool CanShowPanelAsActive(const Panel* panel) const = 0; |
| + // Saves/loads/discards the placement information of |panel|. This is useful |
| + // int bringing back the dragging panel to its original positioning when the |
|
jennb
2012/03/03 02:19:33
typo: int
jianli
2012/03/07 19:14:31
Done.
|
| + // drag is cancelled. |
| + virtual void SavePanelPlacement(Panel* panel) = 0; |
| + virtual void LoadSavedPanelPlacement() = 0; |
|
jennb
2012/03/03 02:19:33
RestorePanelToSavedPlacement()?
jianli
2012/03/07 19:14:31
Done.
|
| + virtual void DiscardSavedPanelPlacement() = 0; |
|
jennb
2012/03/03 02:19:33
Please comment that drag controller will only call
jianli
2012/03/07 19:14:31
Done.
|
| + |
| // Returns true if |panel| is draggable. |
| virtual bool CanDragPanel(const Panel* panel) const = 0; |
| - // Drags |panel| in the bounds of this strip. |
| - virtual void StartDraggingPanel(Panel* panel) = 0; |
| - // |delta_x| and |delta_y| denotes how much the mouse has been moved since |
| - // last time when DragPanel or StartDraggingPanel is called. |
| - virtual void DragPanel(Panel* panel, int delta_x, int delta_y) = 0; |
| - virtual void EndDraggingPanel(Panel* panel, bool cancelled) = 0; |
| + // Starts dragging |panel| within this strip. The panel should already be |
| + // in this strip. |
| + virtual void StartDraggingPanelLocally(Panel* panel) = 0; |
|
jennb
2012/03/03 02:19:33
s/Locally/WithinStrip or InStrip
Locally might be
jianli
2012/03/07 19:14:31
Done.
|
| + |
| + // Drags |panel| within this strip. |
| + // |delta_x| and |delta_y| represents the offset from the last mouse location |
| + // when StartDraggingPanelLocally or DragPanelLocally is called. |
| + virtual void DragPanelLocally(Panel* panel, int delta_x, int delta_y) = 0; |
| + |
| + // Ends dragging |panel| within this strip. |
| + // If |cancelled| is false, |panel| will be positioned to its finalized |
| + // position. Otherwise, |panel| will stay as it is. |
|
jennb
2012/03/03 02:19:33
Add explanation for how the drag is truly cancelle
jianli
2012/03/07 19:14:31
Done.
|
| + virtual void EndDraggingPanelLocally(Panel* panel, bool cancelled) = 0; |
| + |
| + // Adds |panel| to the collection of panels, positions it at |position| |
| + // in screen coordinates, and starts dragging it within this strip. This is |
| + // invoked when the drag leaves other strip and enters this strip. |
| + virtual void AddDraggingPanel(Panel* panel, const gfx::Point& position) = 0; |
| protected: |
| explicit PanelStrip(Type type); |