Chromium Code Reviews| Index: chrome/browser/ui/panels/stacked_panel_collection.h |
| diff --git a/chrome/browser/ui/panels/stacked_panel_collection.h b/chrome/browser/ui/panels/stacked_panel_collection.h |
| index 8d746ba5ed29c02945e0c452cd14caa62b843a1f..cf2ac3a2d668ad46cc09009b9ba3eb32eaf39300 100644 |
| --- a/chrome/browser/ui/panels/stacked_panel_collection.h |
| +++ b/chrome/browser/ui/panels/stacked_panel_collection.h |
| @@ -9,9 +9,15 @@ |
| #include <vector> |
| #include "base/basictypes.h" |
| #include "chrome/browser/ui/panels/panel_collection.h" |
| +#include "chrome/browser/ui/panels/panel_constants.h" |
| +#include "ui/gfx/native_widget_types.h" |
| #include "ui/gfx/rect.h" |
| +class NativePanelStack; |
| class PanelManager; |
| +namespace gfx { |
| +class Vector2d; |
| +} |
| class StackedPanelCollection : public PanelCollection { |
| public: |
| @@ -53,17 +59,40 @@ class StackedPanelCollection : public PanelCollection { |
| Panel* GetPanelAbove(Panel* panel) const; |
| bool HasPanel(Panel* panel) const; |
| - bool empty() const { return panels_.empty(); } |
| + gfx::NativeWindow GetNativeWindow() const; |
|
Dmitry Titov
2013/01/10 00:16:24
lets get native_stack() accessor and then call Get
jianli
2013/01/10 02:05:37
Done.
|
| + |
| + void MoveAllDraggingPanelsInstantly(const gfx::Vector2d& delta_origin); |
| + |
| int num_panels() const { return panels_.size(); } |
| const Panels& panels() const { return panels_; } |
| - Panel* top_panel() const { return panels_.front(); } |
| - Panel* bottom_panel() const { return panels_.back(); } |
| + Panel* top_panel() const { return panels_.empty() ? NULL : panels_.front(); } |
| + Panel* bottom_panel() const { |
| + return panels_.empty() ? NULL : panels_.back(); |
| + } |
| private: |
| - PanelManager* panel_manager_; // Weak, owns us. |
| + struct PanelPlacement { |
| + Panel* panel; |
| + gfx::Point position; |
| + // Used to remember the top panel, if different from |panel|, for use when |
| + // restoring it. When there're only 2 panels in the stack and the bottom |
| + // panel is being dragged out of the stack, both panels will be moved to |
| + // the detached collection. We need to track the top panel in order to |
| + // put it back to the same stack of the dragging panel. |
| + Panel* top_panel; |
| + |
| + PanelPlacement() : panel(NULL), top_panel(NULL) { } |
| + }; |
| + |
| + PanelManager* panel_manager_; |
| + |
| + NativePanelStack* native_stack_; // Weak, own us. |
|
Dmitry Titov
2013/01/10 00:16:24
own -> owns
jianli
2013/01/10 02:05:37
Done.
|
| Panels panels_; // The top panel is in the front of the list. |
| + // Used to save the placement information for a panel. |
| + PanelPlacement saved_panel_placement_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(StackedPanelCollection); |
| }; |