Chromium Code Reviews| 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 const gfx::Point& GetDefaultPanelOrigin(); | |
|
jianli
2012/09/04 21:58:47
Safer to return gfx::Point.
jennb
2012/09/04 23:02:44
Done.
| |
| 71 | |
| 68 private: | 72 private: |
| 69 struct PanelPlacement { | 73 struct PanelPlacement { |
| 70 Panel* panel; | 74 Panel* panel; |
| 71 gfx::Point position; | 75 gfx::Point position; |
| 72 | 76 |
| 73 PanelPlacement() : panel(NULL) { } | 77 PanelPlacement() : panel(NULL) { } |
| 74 }; | 78 }; |
| 75 | 79 |
| 76 PanelManager* panel_manager_; // Weak, owns us. | 80 PanelManager* panel_manager_; // Weak, owns us. |
| 77 | 81 |
| 78 // All panels in the panel strip must fit within this area. | 82 // All panels in the panel strip must fit within this area. |
| 79 gfx::Rect display_area_; | 83 gfx::Rect display_area_; |
| 80 | 84 |
| 81 // Collection of all panels. | 85 // Collection of all panels. |
| 82 Panels panels_; | 86 Panels panels_; |
| 83 | 87 |
| 84 // Used to save the placement information for a panel. | 88 // Used to save the placement information for a panel. |
| 85 PanelPlacement saved_panel_placement_; | 89 PanelPlacement saved_panel_placement_; |
| 86 | 90 |
| 91 // Default top-left position to use for next detached panel if position is | |
| 92 // unspecified by panel creator. | |
| 93 gfx::Point default_panel_origin_; | |
| 94 | |
| 87 DISALLOW_COPY_AND_ASSIGN(DetachedPanelStrip); | 95 DISALLOW_COPY_AND_ASSIGN(DetachedPanelStrip); |
| 88 }; | 96 }; |
| 89 | 97 |
| 90 #endif // CHROME_BROWSER_UI_PANELS_DETACHED_PANEL_STRIP_H_ | 98 #endif // CHROME_BROWSER_UI_PANELS_DETACHED_PANEL_STRIP_H_ |
| OLD | NEW |