OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_PANELS_DETACHED_PANEL_STRIP_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_DETACHED_PANEL_STRIP_H_ |
6 #define CHROME_BROWSER_UI_PANELS_DETACHED_PANEL_STRIP_H_ | 6 #define CHROME_BROWSER_UI_PANELS_DETACHED_PANEL_STRIP_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 virtual bool RemovePanel(Panel* panel) OVERRIDE; | 31 virtual bool RemovePanel(Panel* panel) OVERRIDE; |
32 virtual void CloseAll() OVERRIDE; | 32 virtual void CloseAll() OVERRIDE; |
33 virtual void ResizePanelWindow( | 33 virtual void ResizePanelWindow( |
34 Panel* panel, | 34 Panel* panel, |
35 const gfx::Size& preferred_window_size) OVERRIDE; | 35 const gfx::Size& preferred_window_size) OVERRIDE; |
36 virtual void OnPanelAttentionStateChanged(Panel* panel) OVERRIDE; | 36 virtual void OnPanelAttentionStateChanged(Panel* panel) OVERRIDE; |
37 virtual void ActivatePanel(Panel* panel) OVERRIDE; | 37 virtual void ActivatePanel(Panel* panel) OVERRIDE; |
38 virtual void MinimizePanel(Panel* panel) OVERRIDE; | 38 virtual void MinimizePanel(Panel* panel) OVERRIDE; |
39 virtual void RestorePanel(Panel* panel) OVERRIDE; | 39 virtual void RestorePanel(Panel* panel) OVERRIDE; |
40 virtual bool CanShowPanelAsActive(const Panel* panel) const OVERRIDE; | 40 virtual bool CanShowPanelAsActive(const Panel* panel) const OVERRIDE; |
| 41 virtual void SavePanelPlacement(Panel* panel) OVERRIDE; |
| 42 virtual void LoadSavedPanelPlacement() OVERRIDE; |
| 43 virtual void DiscardSavedPanelPlacement() OVERRIDE; |
41 virtual bool CanDragPanel(const Panel* panel) const OVERRIDE; | 44 virtual bool CanDragPanel(const Panel* panel) const OVERRIDE; |
42 virtual void StartDraggingPanel(Panel* panel) OVERRIDE; | 45 virtual void StartDraggingPanelLocally(Panel* panel) OVERRIDE; |
43 virtual void DragPanel(Panel* panel, int delta_x, int delta_y) OVERRIDE; | 46 virtual void DragPanelLocally(Panel* panel, |
44 virtual void EndDraggingPanel(Panel* panel, bool cancelled) OVERRIDE; | 47 int delta_x, |
| 48 int delta_y) OVERRIDE; |
| 49 virtual void EndDraggingPanelLocally(Panel* panel, bool cancelled) OVERRIDE; |
| 50 virtual void AddDraggingPanel(Panel* panel, |
| 51 const gfx::Point& position) OVERRIDE; |
45 | 52 |
46 bool HasPanel(Panel* panel) const; | 53 bool HasPanel(Panel* panel) const; |
47 | 54 |
48 int num_panels() const { return panels_.size(); } | 55 int num_panels() const { return panels_.size(); } |
49 const Panels& panels() const { return panels_; } | 56 const Panels& panels() const { return panels_; } |
50 | 57 |
51 private: | 58 private: |
| 59 struct PanelPlacement { |
| 60 Panel* panel; |
| 61 gfx::Point position; |
| 62 |
| 63 PanelPlacement() : panel(NULL) { } |
| 64 }; |
| 65 |
52 PanelManager* panel_manager_; // Weak, owns us. | 66 PanelManager* panel_manager_; // Weak, owns us. |
53 | 67 |
54 // All panels in the panel strip must fit within this area. | 68 // All panels in the panel strip must fit within this area. |
55 gfx::Rect display_area_; | 69 gfx::Rect display_area_; |
56 | 70 |
57 // Collection of all panels. | 71 // Collection of all panels. |
58 Panels panels_; | 72 Panels panels_; |
59 | 73 |
| 74 // Used to save the placement information for a panel. |
| 75 PanelPlacement saved_panel_placement_; |
| 76 |
60 DISALLOW_COPY_AND_ASSIGN(DetachedPanelStrip); | 77 DISALLOW_COPY_AND_ASSIGN(DetachedPanelStrip); |
61 }; | 78 }; |
62 | 79 |
63 #endif // CHROME_BROWSER_UI_PANELS_DETACHED_PANEL_STRIP_H_ | 80 #endif // CHROME_BROWSER_UI_PANELS_DETACHED_PANEL_STRIP_H_ |
OLD | NEW |