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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 } | 111 } |
112 | 112 |
113 // Tests should disable mouse watching if mouse movements will be simulated. | 113 // Tests should disable mouse watching if mouse movements will be simulated. |
114 void disable_mouse_watching() { | 114 void disable_mouse_watching() { |
115 mouse_watching_disabled_ = true; | 115 mouse_watching_disabled_ = true; |
116 } | 116 } |
117 #endif | 117 #endif |
118 | 118 |
119 private: | 119 private: |
120 friend struct base::DefaultLazyInstanceTraits<PanelManager>; | 120 friend struct base::DefaultLazyInstanceTraits<PanelManager>; |
| 121 FRIEND_TEST_ALL_PREFIXES(PanelBrowserTest, SizeClamping); |
121 | 122 |
122 enum TitlebarAction { | 123 enum TitlebarAction { |
123 NO_ACTION, | 124 NO_ACTION, |
124 BRING_UP, | 125 BRING_UP, |
125 BRING_DOWN | 126 BRING_DOWN |
126 }; | 127 }; |
127 | 128 |
128 PanelManager(); | 129 PanelManager(); |
129 virtual ~PanelManager(); | 130 virtual ~PanelManager(); |
130 | 131 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 215 |
215 // Whether or not bounds will be updated when the preferred content size is | 216 // Whether or not bounds will be updated when the preferred content size is |
216 // changed. The testing code could set this flag to false so that other tests | 217 // changed. The testing code could set this flag to false so that other tests |
217 // will not be affected. | 218 // will not be affected. |
218 bool auto_sizing_enabled_; | 219 bool auto_sizing_enabled_; |
219 | 220 |
220 bool mouse_watching_disabled_; // For tests to simulate mouse movements. | 221 bool mouse_watching_disabled_; // For tests to simulate mouse movements. |
221 | 222 |
222 static const int kPanelsHorizontalSpacing = 4; | 223 static const int kPanelsHorizontalSpacing = 4; |
223 | 224 |
224 // Minimum width and height of a panel. | 225 // Absolute minimum width and height for panels, including non-client area. |
225 // Note: The minimum size of a widget (see widget.cc) is fixed to 100x100. | 226 // Should only be big enough to accomodate a close button on the reasonably |
226 // TODO(jianli): Need to fix this to support smaller panel. | 227 // recognisable titlebar. |
227 // http://crbug.com/102708 | |
228 static const int kPanelMinWidth = 100; | 228 static const int kPanelMinWidth = 100; |
229 static const int kPanelMinHeight = 100; | 229 static const int kPanelMinHeight = 20; |
230 | 230 |
231 DISALLOW_COPY_AND_ASSIGN(PanelManager); | 231 DISALLOW_COPY_AND_ASSIGN(PanelManager); |
232 }; | 232 }; |
233 | 233 |
234 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ | 234 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ |
OLD | NEW |