OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PANEL_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ |
6 #define CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 Panel* CreatePanel(Browser* browser); | 31 Panel* CreatePanel(Browser* browser); |
32 | 32 |
33 void Remove(Panel* panel); | 33 void Remove(Panel* panel); |
34 void RemoveAll(); | 34 void RemoveAll(); |
35 | 35 |
36 // Drags the given panel. | 36 // Drags the given panel. |
37 void StartDragging(Panel* panel); | 37 void StartDragging(Panel* panel); |
38 void Drag(int delta_x); | 38 void Drag(int delta_x); |
39 void EndDragging(bool cancelled); | 39 void EndDragging(bool cancelled); |
40 | 40 |
| 41 // Invoked when the preferred window size of the given panel might need to |
| 42 // get changed. |
| 43 void OnPreferredWindowSizeChanged( |
| 44 Panel* panel, const gfx::Size& preferred_window_size); |
| 45 |
41 // Should we bring up the titlebar, given the current mouse point? | 46 // Should we bring up the titlebar, given the current mouse point? |
42 bool ShouldBringUpTitleBarForAllMinimizedPanels(int mouse_x, | 47 bool ShouldBringUpTitleBarForAllMinimizedPanels(int mouse_x, |
43 int mouse_y) const; | 48 int mouse_y) const; |
44 | 49 |
45 // Brings up or down the title-bar for all minimized panels. | 50 // Brings up or down the title-bar for all minimized panels. |
46 void BringUpOrDownTitleBarForAllMinimizedPanels(bool bring_up); | 51 void BringUpOrDownTitleBarForAllMinimizedPanels(bool bring_up); |
47 | 52 |
48 int num_panels() const { return panels_.size(); } | 53 int num_panels() const { return panels_.size(); } |
49 | 54 |
50 private: | 55 private: |
(...skipping 25 matching lines...) Expand all Loading... |
76 bool ComputeBoundsForNextPanel(gfx::Rect* bounds, bool allow_size_change); | 81 bool ComputeBoundsForNextPanel(gfx::Rect* bounds, bool allow_size_change); |
77 | 82 |
78 // Finds one panel to close so that we may have space for the new panel | 83 // Finds one panel to close so that we may have space for the new panel |
79 // created by |extension|. | 84 // created by |extension|. |
80 void FindAndClosePanelOnOverflow(const Extension* extension); | 85 void FindAndClosePanelOnOverflow(const Extension* extension); |
81 | 86 |
82 // Help functions to drag the given panel. | 87 // Help functions to drag the given panel. |
83 void DragLeft(); | 88 void DragLeft(); |
84 void DragRight(); | 89 void DragRight(); |
85 | 90 |
| 91 // Updates the maximum size of each panel as the result of adding, removing, |
| 92 // or sizing panels. |
| 93 void UpdateMaxSizeForAllPanels(); |
| 94 |
86 Panels panels_; | 95 Panels panels_; |
87 | 96 |
88 // Stores the panels that are pending to remove. We want to delay the removal | 97 // Stores the panels that are pending to remove. We want to delay the removal |
89 // when we're in the process of the dragging. | 98 // when we're in the process of the dragging. |
90 Panels panels_pending_to_remove_; | 99 Panels panels_pending_to_remove_; |
91 | 100 |
92 // Current work area used in computing the panel bounds. | 101 // Current work area used in computing the panel bounds. |
93 gfx::Rect work_area_; | 102 gfx::Rect work_area_; |
94 | 103 |
95 // Used in computing the bounds of the next panel. | 104 // Used in computing the bounds of the next panel. |
(...skipping 12 matching lines...) Expand all Loading... |
108 | 117 |
109 // Bounds of the panel to drag. It is first set to the original bounds when | 118 // Bounds of the panel to drag. It is first set to the original bounds when |
110 // the dragging happens. Then it is updated to the position that will be set | 119 // the dragging happens. Then it is updated to the position that will be set |
111 // to when the dragging ends. | 120 // to when the dragging ends. |
112 gfx::Rect dragging_panel_bounds_; | 121 gfx::Rect dragging_panel_bounds_; |
113 | 122 |
114 DISALLOW_COPY_AND_ASSIGN(PanelManager); | 123 DISALLOW_COPY_AND_ASSIGN(PanelManager); |
115 }; | 124 }; |
116 | 125 |
117 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ | 126 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ |
OLD | NEW |