OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/timer.h" | |
14 #include "chrome/browser/ui/panels/auto_hiding_desktop_bar.h" | 15 #include "chrome/browser/ui/panels/auto_hiding_desktop_bar.h" |
15 #include "chrome/browser/ui/panels/panel.h" | 16 #include "chrome/browser/ui/panels/panel.h" |
16 #include "chrome/browser/ui/panels/panel_mouse_watcher_observer.h" | 17 #include "chrome/browser/ui/panels/panel_mouse_watcher_observer.h" |
17 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" |
18 | 19 |
19 class Browser; | 20 class Browser; |
20 class Panel; | 21 class Panel; |
21 class PanelMouseWatcher; | 22 class PanelMouseWatcher; |
22 | 23 |
23 // This class manages a set of panels. | 24 // This class manages a set of panels. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 // Moves a panel to the panel strip. The panel does not currently | 84 // Moves a panel to the panel strip. The panel does not currently |
84 // belong in any other strip. This may cause other panels to be | 85 // belong in any other strip. This may cause other panels to be |
85 // bumped out of the panel strip. | 86 // bumped out of the panel strip. |
86 void MoveToPanelStrip(Panel* panel); | 87 void MoveToPanelStrip(Panel* panel); |
87 | 88 |
88 // Moves a panel to the overflow strip. The panel does not currently | 89 // Moves a panel to the overflow strip. The panel does not currently |
89 // belong in any other strip. | 90 // belong in any other strip. |
90 // |is_new| is true if the panel was just created. | 91 // |is_new| is true if the panel was just created. |
91 void MoveToOverflowStrip(Panel* panel, bool is_new); | 92 void MoveToOverflowStrip(Panel* panel, bool is_new); |
92 | 93 |
93 // Overridden from PanelMouseWatcherObserver: | 94 // Overridden from PanelMouseWatcher::Observer: |
Dmitry Titov
2011/11/30 01:35:53
Isn't it now PanelMouseWatcherObserver?
prasadt
2011/11/30 02:38:47
Done.
| |
94 virtual void OnMouseMove(const gfx::Point& mouse_position) OVERRIDE; | 95 virtual void OnMouseMove(const gfx::Point& mouse_position) OVERRIDE; |
95 | 96 |
97 bool is_full_screen_mode_on() const { return is_full_screen_mode_on_; } | |
98 | |
96 #ifdef UNIT_TEST | 99 #ifdef UNIT_TEST |
97 static int horizontal_spacing() { return kPanelsHorizontalSpacing; } | 100 static int horizontal_spacing() { return kPanelsHorizontalSpacing; } |
98 | 101 |
99 const gfx::Rect& work_area() const { | 102 const gfx::Rect& work_area() const { |
100 return work_area_; | 103 return work_area_; |
101 } | 104 } |
102 | 105 |
103 void set_auto_hiding_desktop_bar( | 106 void set_auto_hiding_desktop_bar( |
104 AutoHidingDesktopBar* auto_hiding_desktop_bar) { | 107 AutoHidingDesktopBar* auto_hiding_desktop_bar) { |
105 auto_hiding_desktop_bar_ = auto_hiding_desktop_bar; | 108 auto_hiding_desktop_bar_ = auto_hiding_desktop_bar; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 // Owned by MessageLoop after posting. | 227 // Owned by MessageLoop after posting. |
225 base::WeakPtrFactory<PanelManager> titlebar_action_factory_; | 228 base::WeakPtrFactory<PanelManager> titlebar_action_factory_; |
226 | 229 |
227 // Whether or not bounds will be updated when the preferred content size is | 230 // Whether or not bounds will be updated when the preferred content size is |
228 // changed. The testing code could set this flag to false so that other tests | 231 // changed. The testing code could set this flag to false so that other tests |
229 // will not be affected. | 232 // will not be affected. |
230 bool auto_sizing_enabled_; | 233 bool auto_sizing_enabled_; |
231 | 234 |
232 bool mouse_watching_disabled_; // For tests to simulate mouse movements. | 235 bool mouse_watching_disabled_; // For tests to simulate mouse movements. |
233 | 236 |
237 // Timer used to track if the current active app is in full screen mode. | |
238 base::RepeatingTimer<PanelManager> full_screen_mode_timer_; | |
239 void CheckFullScreenMode(); | |
240 bool is_full_screen_mode_on_; | |
241 | |
234 static const int kPanelsHorizontalSpacing = 4; | 242 static const int kPanelsHorizontalSpacing = 4; |
235 | 243 |
236 // Absolute minimum width and height for panels, including non-client area. | 244 // Absolute minimum width and height for panels, including non-client area. |
237 // Should only be big enough to accomodate a close button on the reasonably | 245 // Should only be big enough to accomodate a close button on the reasonably |
238 // recognisable titlebar. | 246 // recognisable titlebar. |
239 static const int kPanelMinWidth; | 247 static const int kPanelMinWidth; |
240 static const int kPanelMinHeight; | 248 static const int kPanelMinHeight; |
241 | 249 |
250 static const int kFullScreenModeCheckInterval = 1000; | |
Dmitry Titov
2011/11/30 01:35:53
this is implementation detail, does not have to be
jianli
2011/11/30 01:53:15
Can this constant be moved to .cc file?
prasadt
2011/11/30 02:38:47
Done.
prasadt
2011/11/30 02:38:47
Done.
| |
251 | |
242 DISALLOW_COPY_AND_ASSIGN(PanelManager); | 252 DISALLOW_COPY_AND_ASSIGN(PanelManager); |
243 }; | 253 }; |
244 | 254 |
245 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ | 255 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ |
OLD | NEW |