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_DOCKED_PANEL_STRIP_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_DOCKED_PANEL_STRIP_H_ |
6 #define CHROME_BROWSER_UI_PANELS_DOCKED_PANEL_STRIP_H_ | 6 #define CHROME_BROWSER_UI_PANELS_DOCKED_PANEL_STRIP_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <set> | 10 #include <set> |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 void OnFullScreenModeChanged(bool is_full_screen); | 101 void OnFullScreenModeChanged(bool is_full_screen); |
102 | 102 |
103 // Returns |true| if panel can fit in the dock strip. | 103 // Returns |true| if panel can fit in the dock strip. |
104 bool CanFitPanel(const Panel* panel) const; | 104 bool CanFitPanel(const Panel* panel) const; |
105 | 105 |
106 #ifdef UNIT_TEST | 106 #ifdef UNIT_TEST |
107 int num_temporary_layout_panels() const { | 107 int num_temporary_layout_panels() const { |
108 return panels_in_temporary_layout_.size(); | 108 return panels_in_temporary_layout_.size(); |
109 } | 109 } |
| 110 |
| 111 int minimized_panel_count() const {return minimized_panel_count_; } |
110 #endif | 112 #endif |
111 | 113 |
112 private: | 114 private: |
113 enum TitlebarAction { | 115 enum TitlebarAction { |
114 NO_ACTION, | 116 NO_ACTION, |
115 BRING_UP, | 117 BRING_UP, |
116 BRING_DOWN | 118 BRING_DOWN |
117 }; | 119 }; |
118 | 120 |
119 struct PanelPlacement { | 121 struct PanelPlacement { |
120 Panel* panel; | 122 Panel* panel; |
121 // Used to remember the panel to the left of |panel|, if any, for use when | 123 // Used to remember the panel to the left of |panel|, if any, for use when |
122 // restoring the position of |panel|. Will be updated if this panel is | 124 // restoring the position of |panel|. Will be updated if this panel is |
123 // closed or moved out of the dock (e.g. to overflow).. | 125 // closed or moved out of the dock (e.g. to overflow).. |
124 Panel* left_panel; | 126 Panel* left_panel; |
125 | 127 |
126 PanelPlacement() : panel(NULL) { } | 128 PanelPlacement() : panel(NULL) { } |
127 }; | 129 }; |
128 | 130 |
129 // Overridden from PanelMouseWatcherObserver: | 131 // Overridden from PanelMouseWatcherObserver: |
130 virtual void OnMouseMove(const gfx::Point& mouse_position) OVERRIDE; | 132 virtual void OnMouseMove(const gfx::Point& mouse_position) OVERRIDE; |
131 | 133 |
132 // Helper methods to put the panel to the collection. | 134 // Helper methods to put the panel to the collection. |
133 void InsertNewlyCreatedPanel(Panel* panel); | 135 void InsertNewlyCreatedPanel(Panel* panel); |
134 void InsertExistingPanelAtKnownPosition(Panel* panel); | 136 void InsertExistingPanelAtKnownPosition(Panel* panel); |
135 void InsertExistingPanelAtDefaultPosition(Panel* panel, bool refresh_bounds); | 137 void InsertExistingPanelAtDefaultPosition(Panel* panel, bool refresh_bounds); |
136 | 138 |
137 // Keep track of the minimized panels to control mouse watching. | 139 // Keep track of the minimized panels to control mouse watching. |
138 void IncrementMinimizedPanels(); | 140 void UpdateMinimizedPanelCount(); |
139 void DecrementMinimizedPanels(); | |
140 | 141 |
141 // Help functions to drag the given panel. | 142 // Help functions to drag the given panel. |
142 void DragLeft(Panel* dragging_panel); | 143 void DragLeft(Panel* dragging_panel); |
143 void DragRight(Panel* dragging_panel); | 144 void DragRight(Panel* dragging_panel); |
144 | 145 |
145 // Does the real job of bringing up or down the titlebars. | 146 // Does the real job of bringing up or down the titlebars. |
146 void DoBringUpOrDownTitlebars(bool bring_up); | 147 void DoBringUpOrDownTitlebars(bool bring_up); |
147 // The callback for a delyed task, checks if it still need to perform | 148 // The callback for a delyed task, checks if it still need to perform |
148 // the delayed action. | 149 // the delayed action. |
149 void DelayedBringUpOrDownTitlebarsCheck(); | 150 void DelayedBringUpOrDownTitlebarsCheck(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // Absolute minimum width and height for panels, including non-client area. | 197 // Absolute minimum width and height for panels, including non-client area. |
197 // Should only be big enough to accomodate a close button on the reasonably | 198 // Should only be big enough to accomodate a close button on the reasonably |
198 // recognisable titlebar. | 199 // recognisable titlebar. |
199 static const int kPanelMinWidth; | 200 static const int kPanelMinWidth; |
200 static const int kPanelMinHeight; | 201 static const int kPanelMinHeight; |
201 | 202 |
202 DISALLOW_COPY_AND_ASSIGN(DockedPanelStrip); | 203 DISALLOW_COPY_AND_ASSIGN(DockedPanelStrip); |
203 }; | 204 }; |
204 | 205 |
205 #endif // CHROME_BROWSER_UI_PANELS_DOCKED_PANEL_STRIP_H_ | 206 #endif // CHROME_BROWSER_UI_PANELS_DOCKED_PANEL_STRIP_H_ |
OLD | NEW |