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 25 matching lines...) Expand all Loading... | |
36 | 36 |
37 // Rearranges the positions of the panels in the strip. | 37 // Rearranges the positions of the panels in the strip. |
38 // Handles moving panels to/from overflow area as needed. | 38 // Handles moving panels to/from overflow area as needed. |
39 // This is called when the display space has been changed, i.e. working | 39 // This is called when the display space has been changed, i.e. working |
40 // area being changed or a panel being closed. | 40 // area being changed or a panel being closed. |
41 virtual void RefreshLayout() OVERRIDE; | 41 virtual void RefreshLayout() OVERRIDE; |
42 | 42 |
43 // Adds a panel to the strip. The panel may be a newly created panel or one | 43 // Adds a panel to the strip. The panel may be a newly created panel or one |
44 // that is transitioning from another grouping of panels. | 44 // that is transitioning from another grouping of panels. |
45 virtual void AddPanel(Panel* panel) OVERRIDE; | 45 virtual void AddPanel(Panel* panel) OVERRIDE; |
46 virtual bool RemovePanel(Panel* panel) OVERRIDE; | 46 virtual void RemovePanel(Panel* panel) OVERRIDE; |
47 virtual void CloseAll() OVERRIDE; | 47 virtual void CloseAll() OVERRIDE; |
48 virtual void ResizePanelWindow( | 48 virtual void ResizePanelWindow( |
49 Panel* panel, | 49 Panel* panel, |
50 const gfx::Size& preferred_window_size) OVERRIDE; | 50 const gfx::Size& preferred_window_size) OVERRIDE; |
51 virtual void OnPanelAttentionStateChanged(Panel* panel) OVERRIDE; | 51 virtual void OnPanelAttentionStateChanged(Panel* panel) OVERRIDE; |
52 virtual void ActivatePanel(Panel* panel) OVERRIDE; | 52 virtual void ActivatePanel(Panel* panel) OVERRIDE; |
53 virtual void MinimizePanel(Panel* panel) OVERRIDE; | 53 virtual void MinimizePanel(Panel* panel) OVERRIDE; |
54 virtual void RestorePanel(Panel* panel) OVERRIDE; | 54 virtual void RestorePanel(Panel* panel) OVERRIDE; |
55 virtual bool IsPanelMinimized(const Panel* panel) const OVERRIDE; | |
55 virtual bool CanShowPanelAsActive(const Panel* panel) const OVERRIDE; | 56 virtual bool CanShowPanelAsActive(const Panel* panel) const OVERRIDE; |
56 virtual bool CanDragPanel(const Panel* panel) const OVERRIDE; | 57 virtual bool CanDragPanel(const Panel* panel) const OVERRIDE; |
57 virtual void StartDraggingPanel(Panel* panel) OVERRIDE; | 58 virtual void StartDraggingPanel(Panel* panel) OVERRIDE; |
58 virtual void DragPanel(Panel* panel, int delta_x, int delta_y) OVERRIDE; | 59 virtual void DragPanel(Panel* panel, int delta_x, int delta_y) OVERRIDE; |
59 virtual void EndDraggingPanel(Panel* panel, bool cancelled) OVERRIDE; | 60 virtual void EndDraggingPanel(Panel* panel, bool cancelled) OVERRIDE; |
60 | 61 |
61 // Invoked when a panel's expansion state changes. | 62 // Invoked when a panel's expansion state changes. |
62 void OnPanelExpansionStateChanged(Panel* panel); | 63 void OnPanelExpansionStateChanged(Panel* panel); |
63 | 64 |
64 // Returns true if we should bring up the titlebars, given the current mouse | 65 // Returns true if we should bring up the titlebars, given the current mouse |
(...skipping 19 matching lines...) Expand all Loading... | |
84 int GetMaxPanelWidth() const; | 85 int GetMaxPanelWidth() const; |
85 int GetMaxPanelHeight() const; | 86 int GetMaxPanelHeight() const; |
86 int StartingRightPosition() const; | 87 int StartingRightPosition() const; |
87 | 88 |
88 void OnAutoHidingDesktopBarVisibilityChanged( | 89 void OnAutoHidingDesktopBarVisibilityChanged( |
89 AutoHidingDesktopBar::Alignment alignment, | 90 AutoHidingDesktopBar::Alignment alignment, |
90 AutoHidingDesktopBar::Visibility visibility); | 91 AutoHidingDesktopBar::Visibility visibility); |
91 | 92 |
92 void OnFullScreenModeChanged(bool is_full_screen); | 93 void OnFullScreenModeChanged(bool is_full_screen); |
93 | 94 |
95 // Returns |true| if panel can fit in the dock strip. | |
96 bool CanFitPanel(Panel* panel); | |
jianli
2012/03/02 00:11:41
nit: need to add const modifier.
jennb
2012/03/02 01:26:32
Done.
| |
97 | |
94 #ifdef UNIT_TEST | 98 #ifdef UNIT_TEST |
95 int num_temporary_layout_panels() const { | 99 int num_temporary_layout_panels() const { |
96 return panels_in_temporary_layout_.size(); | 100 return panels_in_temporary_layout_.size(); |
97 } | 101 } |
98 #endif | 102 #endif |
99 | 103 |
100 private: | 104 private: |
101 enum TitlebarAction { | 105 enum TitlebarAction { |
102 NO_ACTION, | 106 NO_ACTION, |
103 BRING_UP, | 107 BRING_UP, |
104 BRING_DOWN | 108 BRING_DOWN |
105 }; | 109 }; |
106 | 110 |
107 // Overridden from PanelMouseWatcherObserver: | 111 // Overridden from PanelMouseWatcherObserver: |
108 virtual void OnMouseMove(const gfx::Point& mouse_position) OVERRIDE; | 112 virtual void OnMouseMove(const gfx::Point& mouse_position) OVERRIDE; |
109 | 113 |
114 // Make |width| amount of space available in this strip. | |
115 void EnsureAvailableSpace(int width); | |
116 | |
117 // Move all panels after |overflow_point|, inclusive, to overflow. | |
jianli
2012/03/02 00:11:41
Not sure I understand what overflow_point means? P
jennb
2012/03/02 01:26:32
Done.
| |
118 void MovePanelsToOverflow(Panel* overflow_point); | |
119 | |
110 // Keep track of the minimized panels to control mouse watching. | 120 // Keep track of the minimized panels to control mouse watching. |
111 void IncrementMinimizedPanels(); | 121 void IncrementMinimizedPanels(); |
112 void DecrementMinimizedPanels(); | 122 void DecrementMinimizedPanels(); |
113 | 123 |
114 // Help functions to drag the given panel. | 124 // Help functions to drag the given panel. |
115 void DragLeft(Panel* dragging_panel); | 125 void DragLeft(Panel* dragging_panel); |
116 void DragRight(Panel* dragging_panel); | 126 void DragRight(Panel* dragging_panel); |
117 | 127 |
118 // Does the real job of bringing up or down the titlebars. | 128 // Does the real job of bringing up or down the titlebars. |
119 void DoBringUpOrDownTitlebars(bool bring_up); | 129 void DoBringUpOrDownTitlebars(bool bring_up); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
170 // Absolute minimum width and height for panels, including non-client area. | 180 // Absolute minimum width and height for panels, including non-client area. |
171 // Should only be big enough to accomodate a close button on the reasonably | 181 // Should only be big enough to accomodate a close button on the reasonably |
172 // recognisable titlebar. | 182 // recognisable titlebar. |
173 static const int kPanelMinWidth; | 183 static const int kPanelMinWidth; |
174 static const int kPanelMinHeight; | 184 static const int kPanelMinHeight; |
175 | 185 |
176 DISALLOW_COPY_AND_ASSIGN(DockedPanelStrip); | 186 DISALLOW_COPY_AND_ASSIGN(DockedPanelStrip); |
177 }; | 187 }; |
178 | 188 |
179 #endif // CHROME_BROWSER_UI_PANELS_DOCKED_PANEL_STRIP_H_ | 189 #endif // CHROME_BROWSER_UI_PANELS_DOCKED_PANEL_STRIP_H_ |
OLD | NEW |