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" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // Drags the given panel. | 47 // Drags the given panel. |
48 void StartDragging(Panel* panel); | 48 void StartDragging(Panel* panel); |
49 void Drag(int delta_x, int delta_y); | 49 void Drag(int delta_x, int delta_y); |
50 void EndDragging(bool cancelled); | 50 void EndDragging(bool cancelled); |
51 | 51 |
52 // Invoked when a panel's expansion state changes. | 52 // Invoked when a panel's expansion state changes. |
53 void OnPanelExpansionStateChanged(Panel* panel); | 53 void OnPanelExpansionStateChanged(Panel* panel); |
54 | 54 |
55 // Invoked when the preferred window size of the given panel might need to | 55 // Invoked when the preferred window size of the given panel might need to |
56 // get changed. | 56 // get changed. |
57 void OnPreferredWindowSizeChanged( | 57 void OnWindowAutoResized(Panel* panel, |
58 Panel* panel, const gfx::Size& preferred_window_size); | 58 const gfx::Size& preferred_window_size); |
59 | 59 |
60 // Resizes the panel. Explicitly setting the panel size is not allowed | 60 // Resizes the panel. Explicitly setting the panel size is not allowed |
61 // for panels that are auto-sized. | 61 // for panels that are auto-sized. |
62 void ResizePanel(Panel* panel, const gfx::Size& new_size); | 62 void ResizePanel(Panel* panel, const gfx::Size& new_size); |
63 | 63 |
64 // Returns true if we should bring up the titlebars, given the current mouse | 64 // Returns true if we should bring up the titlebars, given the current mouse |
65 // point. | 65 // point. |
66 bool ShouldBringUpTitlebars(int mouse_x, int mouse_y) const; | 66 bool ShouldBringUpTitlebars(int mouse_x, int mouse_y) const; |
67 | 67 |
68 // Brings up or down the titlebars for all minimized panels. | 68 // Brings up or down the titlebars for all minimized panels. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 // Reduces time interval in tests to shorten test run time. | 108 // Reduces time interval in tests to shorten test run time. |
109 // Wrapper should be used around all time intervals in panels code. | 109 // Wrapper should be used around all time intervals in panels code. |
110 static inline double AdjustTimeInterval(double interval) { | 110 static inline double AdjustTimeInterval(double interval) { |
111 if (shorten_time_intervals_) | 111 if (shorten_time_intervals_) |
112 return interval / 100.0; | 112 return interval / 100.0; |
113 else | 113 else |
114 return interval; | 114 return interval; |
115 } | 115 } |
116 | 116 |
| 117 |
| 118 bool auto_sizing_enabled() const { |
| 119 return auto_sizing_enabled_; |
| 120 } |
| 121 |
117 #ifdef UNIT_TEST | 122 #ifdef UNIT_TEST |
118 static void shorten_time_intervals_for_testing() { | 123 static void shorten_time_intervals_for_testing() { |
119 shorten_time_intervals_ = true; | 124 shorten_time_intervals_ = true; |
120 } | 125 } |
121 | 126 |
122 void set_auto_hiding_desktop_bar( | 127 void set_auto_hiding_desktop_bar( |
123 AutoHidingDesktopBar* auto_hiding_desktop_bar) { | 128 AutoHidingDesktopBar* auto_hiding_desktop_bar) { |
124 auto_hiding_desktop_bar_ = auto_hiding_desktop_bar; | 129 auto_hiding_desktop_bar_ = auto_hiding_desktop_bar; |
125 } | 130 } |
126 | 131 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // Timer used to track if the current active app is in full screen mode. | 208 // Timer used to track if the current active app is in full screen mode. |
204 base::RepeatingTimer<PanelManager> full_screen_mode_timer_; | 209 base::RepeatingTimer<PanelManager> full_screen_mode_timer_; |
205 | 210 |
206 // True if current active app is in full screen mode. | 211 // True if current active app is in full screen mode. |
207 bool is_full_screen_; | 212 bool is_full_screen_; |
208 | 213 |
209 DISALLOW_COPY_AND_ASSIGN(PanelManager); | 214 DISALLOW_COPY_AND_ASSIGN(PanelManager); |
210 }; | 215 }; |
211 | 216 |
212 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ | 217 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ |
OLD | NEW |