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_STRIP_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_ |
6 #define CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_STRIP_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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 #endif | 95 #endif |
96 | 96 |
97 private: | 97 private: |
98 enum TitlebarAction { | 98 enum TitlebarAction { |
99 NO_ACTION, | 99 NO_ACTION, |
100 BRING_UP, | 100 BRING_UP, |
101 BRING_DOWN | 101 BRING_DOWN |
102 }; | 102 }; |
103 | 103 |
104 // Helper functions to add a panel to the strip. | |
105 void AddNewPanel(Panel* panel); | |
106 void AddExistingPanel(Panel* panel); | |
107 | |
108 // Keep track of the minimized panels to control mouse watching. | 104 // Keep track of the minimized panels to control mouse watching. |
109 void IncrementMinimizedPanels(); | 105 void IncrementMinimizedPanels(); |
110 void DecrementMinimizedPanels(); | 106 void DecrementMinimizedPanels(); |
111 | 107 |
112 // Handles all the panels that're delayed to be removed. | 108 // Handles all the panels that're delayed to be removed. |
113 void DelayedRemove(); | 109 void DelayedRemove(); |
114 | 110 |
115 // Does the actual remove. Caller is responsible for rearranging | 111 // Does the actual remove. Caller is responsible for rearranging |
116 // the panel strip if necessary. | 112 // the panel strip if necessary. |
117 // Returns |false| if panel is not in the strip. | 113 // Returns |false| if panel is not in the strip. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // to when the dragging ends. | 171 // to when the dragging ends. |
176 gfx::Rect dragging_panel_bounds_; | 172 gfx::Rect dragging_panel_bounds_; |
177 | 173 |
178 // Delayed transitions support. Sometimes transitions between minimized and | 174 // Delayed transitions support. Sometimes transitions between minimized and |
179 // title-only states are delayed, for better usability with Taskbars/Docks. | 175 // title-only states are delayed, for better usability with Taskbars/Docks. |
180 TitlebarAction delayed_titlebar_action_; | 176 TitlebarAction delayed_titlebar_action_; |
181 bool remove_delays_for_testing_; | 177 bool remove_delays_for_testing_; |
182 // Owned by MessageLoop after posting. | 178 // Owned by MessageLoop after posting. |
183 base::WeakPtrFactory<PanelStrip> titlebar_action_factory_; | 179 base::WeakPtrFactory<PanelStrip> titlebar_action_factory_; |
184 | 180 |
185 // Factory used for moving new panels to overflow after a delay. | |
186 base::WeakPtrFactory<PanelStrip> overflow_action_factory_; | |
187 | |
188 static const int kPanelsHorizontalSpacing = 4; | 181 static const int kPanelsHorizontalSpacing = 4; |
189 | 182 |
190 // Absolute minimum width and height for panels, including non-client area. | 183 // Absolute minimum width and height for panels, including non-client area. |
191 // Should only be big enough to accomodate a close button on the reasonably | 184 // Should only be big enough to accomodate a close button on the reasonably |
192 // recognisable titlebar. | 185 // recognisable titlebar. |
193 static const int kPanelMinWidth; | 186 static const int kPanelMinWidth; |
194 static const int kPanelMinHeight; | 187 static const int kPanelMinHeight; |
195 | 188 |
196 DISALLOW_COPY_AND_ASSIGN(PanelStrip); | 189 DISALLOW_COPY_AND_ASSIGN(PanelStrip); |
197 }; | 190 }; |
198 | 191 |
199 #endif // CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_ | 192 #endif // CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_ |
OLD | NEW |