| 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 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "chrome/browser/ui/panels/panel.h" | 10 #include "chrome/browser/ui/panels/panel.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 bool aborted) OVERRIDE; | 58 bool aborted) OVERRIDE; |
| 59 virtual void ClearDraggingStateWhenPanelClosed() OVERRIDE; | 59 virtual void ClearDraggingStateWhenPanelClosed() OVERRIDE; |
| 60 virtual void UpdatePanelOnStripChange(Panel* panel) OVERRIDE; | 60 virtual void UpdatePanelOnStripChange(Panel* panel) OVERRIDE; |
| 61 virtual void OnPanelActiveStateChanged(Panel* panel) OVERRIDE; | 61 virtual void OnPanelActiveStateChanged(Panel* panel) OVERRIDE; |
| 62 | 62 |
| 63 bool HasPanel(Panel* panel) const; | 63 bool HasPanel(Panel* panel) const; |
| 64 | 64 |
| 65 int num_panels() const { return panels_.size(); } | 65 int num_panels() const { return panels_.size(); } |
| 66 const Panels& panels() const { return panels_; } | 66 const Panels& panels() const { return panels_; } |
| 67 | 67 |
| 68 // Returns default top-left to use for a detached panel whose position is |
| 69 // not specified during panel creation. |
| 70 gfx::Point GetDefaultPanelOrigin(); |
| 71 |
| 68 private: | 72 private: |
| 73 // Offset the default panel top-left position by kPanelTilePixels. Wrap |
| 74 // around to initial position if position goes beyond display area. |
| 75 void ComputeNextDefaultPanelOrigin(); |
| 76 |
| 69 struct PanelPlacement { | 77 struct PanelPlacement { |
| 70 Panel* panel; | 78 Panel* panel; |
| 71 gfx::Point position; | 79 gfx::Point position; |
| 72 | 80 |
| 73 PanelPlacement() : panel(NULL) { } | 81 PanelPlacement() : panel(NULL) { } |
| 74 }; | 82 }; |
| 75 | 83 |
| 76 PanelManager* panel_manager_; // Weak, owns us. | 84 PanelManager* panel_manager_; // Weak, owns us. |
| 77 | 85 |
| 78 // All panels in the panel strip must fit within this area. | 86 // All panels in the panel strip must fit within this area. |
| 79 gfx::Rect display_area_; | 87 gfx::Rect display_area_; |
| 80 | 88 |
| 81 // Collection of all panels. | 89 // Collection of all panels. |
| 82 Panels panels_; | 90 Panels panels_; |
| 83 | 91 |
| 84 // Used to save the placement information for a panel. | 92 // Used to save the placement information for a panel. |
| 85 PanelPlacement saved_panel_placement_; | 93 PanelPlacement saved_panel_placement_; |
| 86 | 94 |
| 95 // Default top-left position to use for next detached panel if position is |
| 96 // unspecified by panel creator. |
| 97 gfx::Point default_panel_origin_; |
| 98 |
| 87 DISALLOW_COPY_AND_ASSIGN(DetachedPanelStrip); | 99 DISALLOW_COPY_AND_ASSIGN(DetachedPanelStrip); |
| 88 }; | 100 }; |
| 89 | 101 |
| 90 #endif // CHROME_BROWSER_UI_PANELS_DETACHED_PANEL_STRIP_H_ | 102 #endif // CHROME_BROWSER_UI_PANELS_DETACHED_PANEL_STRIP_H_ |
| OLD | NEW |