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 "chrome/browser/ui/panels/display_settings_provider.h" | 13 #include "chrome/browser/ui/panels/display_settings_provider.h" |
14 #include "chrome/browser/ui/panels/panel.h" | 14 #include "chrome/browser/ui/panels/panel.h" |
15 #include "chrome/browser/ui/panels/panel_constants.h" | 15 #include "chrome/browser/ui/panels/panel_constants.h" |
16 #include "chrome/browser/ui/panels/panel_strip.h" | 16 #include "chrome/browser/ui/panels/panel_strip.h" |
17 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
18 | 18 |
19 class Browser; | 19 class Browser; |
| 20 class BrowserWindow; |
20 class DetachedPanelStrip; | 21 class DetachedPanelStrip; |
21 class DockedPanelStrip; | 22 class DockedPanelStrip; |
22 class PanelDragController; | 23 class PanelDragController; |
23 class PanelResizeController; | 24 class PanelResizeController; |
24 class PanelMouseWatcher; | 25 class PanelMouseWatcher; |
25 | 26 |
26 // This class manages a set of panels. | 27 // This class manages a set of panels. |
27 class PanelManager : public DisplaySettingsProvider::DisplayAreaObserver, | 28 class PanelManager : public DisplaySettingsProvider::DisplayAreaObserver, |
28 public DisplaySettingsProvider::FullScreenObserver { | 29 public DisplaySettingsProvider::FullScreenObserver { |
29 public: | 30 public: |
(...skipping 27 matching lines...) Expand all Loading... |
57 // Resizes the given panel. | 58 // Resizes the given panel. |
58 // |mouse_location| is in screen coordinate system. | 59 // |mouse_location| is in screen coordinate system. |
59 void StartResizingByMouse(Panel* panel, const gfx::Point& mouse_location, | 60 void StartResizingByMouse(Panel* panel, const gfx::Point& mouse_location, |
60 panel::ResizingSides sides); | 61 panel::ResizingSides sides); |
61 void ResizeByMouse(const gfx::Point& mouse_location); | 62 void ResizeByMouse(const gfx::Point& mouse_location); |
62 void EndResizingByMouse(bool cancelled); | 63 void EndResizingByMouse(bool cancelled); |
63 | 64 |
64 // Resizes the panel and sets the origin. | 65 // Resizes the panel and sets the origin. |
65 void OnPanelResizedByMouse(Panel* panel, const gfx::Rect& new_bounds); | 66 void OnPanelResizedByMouse(Panel* panel, const gfx::Rect& new_bounds); |
66 | 67 |
67 // Invoked when the preferred window size of the given panel might need to | 68 // Resizes the panel. Explicitly setting the panel size will disable |
68 // get changed. | 69 // auto-size for the panel. |
69 void OnWindowAutoResized(Panel* panel, | |
70 const gfx::Size& preferred_window_size); | |
71 | |
72 // Resizes the panel. Explicitly setting the panel size is not allowed | |
73 // for panels that are auto-sized. | |
74 void ResizePanel(Panel* panel, const gfx::Size& new_size); | 70 void ResizePanel(Panel* panel, const gfx::Size& new_size); |
75 | 71 |
76 // Invoked when a panel's expansion state changes. | 72 // Invoked when a panel's expansion state changes. |
77 void OnPanelExpansionStateChanged(Panel* panel); | 73 void OnPanelExpansionStateChanged(Panel* panel); |
78 | 74 |
79 // Moves the |panel| to a different type of panel strip. | 75 // Moves the |panel| to a different type of panel strip. |
80 void MovePanelToStrip(Panel* panel, | 76 void MovePanelToStrip(Panel* panel, |
81 PanelStrip::Type new_layout, | 77 PanelStrip::Type new_layout, |
82 PanelStrip::PositioningMask positioning_mask); | 78 PanelStrip::PositioningMask positioning_mask); |
83 | 79 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 191 |
196 // Whether or not bounds will be updated when the preferred content size is | 192 // Whether or not bounds will be updated when the preferred content size is |
197 // changed. The testing code could set this flag to false so that other tests | 193 // changed. The testing code could set this flag to false so that other tests |
198 // will not be affected. | 194 // will not be affected. |
199 bool auto_sizing_enabled_; | 195 bool auto_sizing_enabled_; |
200 | 196 |
201 DISALLOW_COPY_AND_ASSIGN(PanelManager); | 197 DISALLOW_COPY_AND_ASSIGN(PanelManager); |
202 }; | 198 }; |
203 | 199 |
204 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ | 200 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ |
OLD | NEW |