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_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" |
11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/timer.h" | 13 #include "base/timer.h" |
14 #include "chrome/browser/ui/panels/auto_hiding_desktop_bar.h" | 14 #include "chrome/browser/ui/panels/auto_hiding_desktop_bar.h" |
15 #include "chrome/browser/ui/panels/panel.h" | 15 #include "chrome/browser/ui/panels/panel.h" |
| 16 #include "chrome/browser/ui/panels/panel_strip.h" |
16 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
17 | 18 |
18 class Browser; | 19 class Browser; |
19 class DetachedPanelStrip; | 20 class DetachedPanelStrip; |
20 class DockedPanelStrip; | 21 class DockedPanelStrip; |
21 class OverflowPanelStrip; | 22 class OverflowPanelStrip; |
22 class PanelDragController; | 23 class PanelDragController; |
23 class PanelMouseWatcher; | 24 class PanelMouseWatcher; |
24 | 25 |
25 // This class manages a set of panels. | 26 // This class manages a set of panels. |
(...skipping 28 matching lines...) Expand all Loading... |
54 | 55 |
55 // Invoked when the preferred window size of the given panel might need to | 56 // Invoked when the preferred window size of the given panel might need to |
56 // get changed. | 57 // get changed. |
57 void OnPreferredWindowSizeChanged( | 58 void OnPreferredWindowSizeChanged( |
58 Panel* panel, const gfx::Size& preferred_window_size); | 59 Panel* panel, const gfx::Size& preferred_window_size); |
59 | 60 |
60 // Resizes the panel. Explicitly setting the panel size is not allowed | 61 // Resizes the panel. Explicitly setting the panel size is not allowed |
61 // for panels that are auto-sized. | 62 // for panels that are auto-sized. |
62 void ResizePanel(Panel* panel, const gfx::Size& new_size); | 63 void ResizePanel(Panel* panel, const gfx::Size& new_size); |
63 | 64 |
| 65 // Moves the |panel| to a different type of panel strip. |
| 66 void MovePanelToStrip(Panel* panel, PanelStrip::Type new_layout); |
| 67 |
| 68 // Move all panels up to, and including, the |last_panel_to_move| to overflow. |
| 69 void MovePanelsToOverflow(Panel* last_panel_to_move); |
| 70 |
| 71 // Moves as many panels out of overflow as space allows. |
| 72 void MovePanelsOutOfOverflowIfCanFit(); |
| 73 |
64 // Returns true if we should bring up the titlebars, given the current mouse | 74 // Returns true if we should bring up the titlebars, given the current mouse |
65 // point. | 75 // point. |
66 bool ShouldBringUpTitlebars(int mouse_x, int mouse_y) const; | 76 bool ShouldBringUpTitlebars(int mouse_x, int mouse_y) const; |
67 | 77 |
68 // Brings up or down the titlebars for all minimized panels. | 78 // Brings up or down the titlebars for all minimized panels. |
69 void BringUpOrDownTitlebars(bool bring_up); | 79 void BringUpOrDownTitlebars(bool bring_up); |
70 | 80 |
71 // Returns the next browser window which could be either panel window or | 81 // Returns the next browser window which could be either panel window or |
72 // tabbed window, to switch to if the given panel is going to be deactivated. | 82 // tabbed window, to switch to if the given panel is going to be deactivated. |
73 // Returns NULL if such window cannot be found. | 83 // Returns NULL if such window cannot be found. |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // changed. The testing code could set this flag to false so that other tests | 209 // changed. The testing code could set this flag to false so that other tests |
200 // will not be affected. | 210 // will not be affected. |
201 bool auto_sizing_enabled_; | 211 bool auto_sizing_enabled_; |
202 | 212 |
203 // Timer used to track if the current active app is in full screen mode. | 213 // Timer used to track if the current active app is in full screen mode. |
204 base::RepeatingTimer<PanelManager> full_screen_mode_timer_; | 214 base::RepeatingTimer<PanelManager> full_screen_mode_timer_; |
205 | 215 |
206 // True if current active app is in full screen mode. | 216 // True if current active app is in full screen mode. |
207 bool is_full_screen_; | 217 bool is_full_screen_; |
208 | 218 |
| 219 // True only while moving panels to overflow. Used to prevent moving panels |
| 220 // out of overflow while in the process of moving panels to overflow. |
| 221 bool is_processing_overflow_; |
| 222 |
209 DISALLOW_COPY_AND_ASSIGN(PanelManager); | 223 DISALLOW_COPY_AND_ASSIGN(PanelManager); |
210 }; | 224 }; |
211 | 225 |
212 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ | 226 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ |
OLD | NEW |