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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 void DelayedRemove(); | 141 void DelayedRemove(); |
142 | 142 |
143 // Does the remove. Called from Remove and DelayedRemove. | 143 // Does the remove. Called from Remove and DelayedRemove. |
144 void DoRemove(Panel* panel); | 144 void DoRemove(Panel* panel); |
145 | 145 |
146 // Rearranges the positions of the panels starting from the given iterator. | 146 // Rearranges the positions of the panels starting from the given iterator. |
147 // This is called when the display space has been changed, i.e. working | 147 // This is called when the display space has been changed, i.e. working |
148 // area being changed or a panel being closed. | 148 // area being changed or a panel being closed. |
149 void Rearrange(Panels::iterator iter_to_start, int rightmost_position); | 149 void Rearrange(Panels::iterator iter_to_start, int rightmost_position); |
150 | 150 |
151 // Finds one panel to close so that we may have space for the new panel | |
152 // created by |extension|. | |
153 void FindAndClosePanelOnOverflow(const Extension* extension); | |
154 | |
155 // Help functions to drag the given panel. | 151 // Help functions to drag the given panel. |
156 void DragLeft(); | 152 void DragLeft(); |
157 void DragRight(); | 153 void DragRight(); |
158 | 154 |
159 // Checks if the titlebars have been brought up or down. If not, do not wait | 155 // Checks if the titlebars have been brought up or down. If not, do not wait |
160 // for the notifications to trigger it any more, and start to bring them up or | 156 // for the notifications to trigger it any more, and start to bring them up or |
161 // down immediately. | 157 // down immediately. |
162 void DelayedBringUpOrDownTitlebarsCheck(); | 158 void DelayedBringUpOrDownTitlebarsCheck(); |
163 | 159 |
164 // Does the real job of bringing up or down the titlebars. | 160 // Does the real job of bringing up or down the titlebars. |
165 void DoBringUpOrDownTitlebars(bool bring_up); | 161 void DoBringUpOrDownTitlebars(bool bring_up); |
166 | 162 |
167 int GetMaxPanelWidth() const; | 163 int GetMaxPanelWidth() const; |
168 int GetMaxPanelHeight() const; | 164 int GetMaxPanelHeight() const; |
169 int GetRightMostAvailablePosition() const; | 165 int GetRightMostAvailablePosition() const; |
170 | 166 |
171 // Updates the maximum size of each panel as the result of adding, removing, | |
172 // or sizing panels. | |
173 void UpdateMaxSizeForAllPanels(); | |
174 | |
175 Panels panels_; | 167 Panels panels_; |
176 | 168 |
177 // Stores the panels that are pending to remove. We want to delay the removal | 169 // Stores the panels that are pending to remove. We want to delay the removal |
178 // when we're in the process of the dragging. | 170 // when we're in the process of the dragging. |
179 Panels panels_pending_to_remove_; | 171 Panels panels_pending_to_remove_; |
180 | 172 |
181 // Use a mouse watcher to know when to bring up titlebars to "peek" at | 173 // Use a mouse watcher to know when to bring up titlebars to "peek" at |
182 // minimized panels. Mouse movement is only tracked when there is a minimized | 174 // minimized panels. Mouse movement is only tracked when there is a minimized |
183 // panel. | 175 // panel. |
184 scoped_ptr<PanelMouseWatcher> panel_mouse_watcher_; | 176 scoped_ptr<PanelMouseWatcher> panel_mouse_watcher_; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // Minimum width and height of a panel. | 217 // Minimum width and height of a panel. |
226 // Note: The minimum size of a widget (see widget.cc) is fixed to 100x100. | 218 // Note: The minimum size of a widget (see widget.cc) is fixed to 100x100. |
227 // TODO(jianli): Need to fix this to support smaller panel. | 219 // TODO(jianli): Need to fix this to support smaller panel. |
228 static const int kPanelMinWidth = 100; | 220 static const int kPanelMinWidth = 100; |
229 static const int kPanelMinHeight = 100; | 221 static const int kPanelMinHeight = 100; |
230 | 222 |
231 DISALLOW_COPY_AND_ASSIGN(PanelManager); | 223 DISALLOW_COPY_AND_ASSIGN(PanelManager); |
232 }; | 224 }; |
233 | 225 |
234 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ | 226 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ |
OLD | NEW |