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_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 <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 // Returns |false| if the panel is not in the strip. | 40 // Returns |false| if the panel is not in the strip. |
41 bool Remove(Panel* panel); | 41 bool Remove(Panel* panel); |
42 void RemoveAll(); | 42 void RemoveAll(); |
43 | 43 |
44 // Drags the given panel. | 44 // Drags the given panel. |
45 void StartDragging(Panel* panel); | 45 void StartDragging(Panel* panel); |
46 void Drag(int delta_x); | 46 void Drag(int delta_x); |
47 void EndDragging(bool cancelled); | 47 void EndDragging(bool cancelled); |
48 | 48 |
| 49 // Invoked when a panel's layout state changes. |
| 50 void OnPanelLayoutStateChanged(Panel* panel, Panel::LayoutState old_state); |
| 51 |
49 // Invoked when a panel's expansion state changes. | 52 // Invoked when a panel's expansion state changes. |
50 void OnPanelExpansionStateChanged(Panel* panel); | 53 void OnPanelExpansionStateChanged(Panel* panel, |
| 54 Panel::ExpansionState old_state); |
51 | 55 |
52 // Invoked when the window size of the given panel is changed. | 56 // Invoked when the window size of the given panel is changed. |
53 void OnWindowSizeChanged( | 57 void OnWindowSizeChanged( |
54 Panel* panel, const gfx::Size& preferred_window_size); | 58 Panel* panel, const gfx::Size& preferred_window_size); |
55 | 59 |
56 // Returns true if we should bring up the titlebars, given the current mouse | 60 // Returns true if we should bring up the titlebars, given the current mouse |
57 // point. | 61 // point. |
58 bool ShouldBringUpTitlebars(int mouse_x, int mouse_y) const; | 62 bool ShouldBringUpTitlebars(int mouse_x, int mouse_y) const; |
59 | 63 |
60 // Brings up or down the titlebars for all minimized panels. | 64 // Brings up or down the titlebars for all minimized panels. |
61 void BringUpOrDownTitlebars(bool bring_up); | 65 void BringUpOrDownTitlebars(bool bring_up); |
62 | 66 |
63 // Returns the bottom position for the panel per its expansion state. If auto- | 67 // Returns the bottom position for the panel per its expansion state. If auto- |
64 // hide bottom bar is present, we want to move the minimized panel to the | 68 // hide bottom bar is present, we want to move the minimized panel to the |
65 // bottom of the screen, not the bottom of the work area. | 69 // bottom of the screen, not the bottom of the work area. |
66 int GetBottomPositionForExpansionState( | 70 int GetBottomPositionForExpansionState( |
67 Panel::ExpansionState expansion_state) const; | 71 Panel::ExpansionState expansion_state) const; |
68 | 72 |
| 73 void UpdateBoundsPerExpansionState(Panel* panel); |
| 74 |
69 // num_panels() and panels() only includes panels in the panel strip that | 75 // num_panels() and panels() only includes panels in the panel strip that |
70 // do NOT have a temporary layout. | 76 // do NOT have a temporary layout. |
71 int num_panels() const { return panels_.size(); } | 77 int num_panels() const { return panels_.size(); } |
72 const Panels& panels() const { return panels_; } | 78 const Panels& panels() const { return panels_; } |
73 | 79 |
74 bool is_dragging_panel() const; | 80 bool is_dragging_panel() const; |
75 gfx::Rect display_area() const { return display_area_; } | 81 gfx::Rect display_area() const { return display_area_; } |
76 | 82 |
77 int GetMaxPanelWidth() const; | 83 int GetMaxPanelWidth() const; |
78 int GetMaxPanelHeight() const; | 84 int GetMaxPanelHeight() const; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // Absolute minimum width and height for panels, including non-client area. | 185 // Absolute minimum width and height for panels, including non-client area. |
180 // Should only be big enough to accomodate a close button on the reasonably | 186 // Should only be big enough to accomodate a close button on the reasonably |
181 // recognisable titlebar. | 187 // recognisable titlebar. |
182 static const int kPanelMinWidth; | 188 static const int kPanelMinWidth; |
183 static const int kPanelMinHeight; | 189 static const int kPanelMinHeight; |
184 | 190 |
185 DISALLOW_COPY_AND_ASSIGN(PanelStrip); | 191 DISALLOW_COPY_AND_ASSIGN(PanelStrip); |
186 }; | 192 }; |
187 | 193 |
188 #endif // CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_ | 194 #endif // CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_ |
OLD | NEW |