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_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_H_ |
6 #define CHROME_BROWSER_UI_PANELS_PANEL_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 // Panel size is restricted to certain limits. | 24 // Panel size is restricted to certain limits. |
25 // - Invoke an appropriate PanelManager function to do stuff that might affect | 25 // - Invoke an appropriate PanelManager function to do stuff that might affect |
26 // other Panels. For example deleting a panel would rearrange other panels. | 26 // other Panels. For example deleting a panel would rearrange other panels. |
27 class Panel : public BrowserWindow { | 27 class Panel : public BrowserWindow { |
28 public: | 28 public: |
29 virtual ~Panel(); | 29 virtual ~Panel(); |
30 | 30 |
31 // Returns the PanelManager associated with this panel. | 31 // Returns the PanelManager associated with this panel. |
32 PanelManager* manager() const; | 32 PanelManager* manager() const; |
33 | 33 |
34 void Minimize(); | |
35 void Restore(); | |
36 | |
37 // BrowserWindow overrides. | 34 // BrowserWindow overrides. |
38 virtual void Show() OVERRIDE; | 35 virtual void Show() OVERRIDE; |
39 virtual void ShowInactive() OVERRIDE; | 36 virtual void ShowInactive() OVERRIDE; |
40 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; | 37 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; |
41 virtual void Close() OVERRIDE; | 38 virtual void Close() OVERRIDE; |
42 virtual void Activate() OVERRIDE; | 39 virtual void Activate() OVERRIDE; |
43 virtual void Deactivate() OVERRIDE; | 40 virtual void Deactivate() OVERRIDE; |
44 virtual bool IsActive() const OVERRIDE; | 41 virtual bool IsActive() const OVERRIDE; |
45 virtual void FlashFrame() OVERRIDE; | 42 virtual void FlashFrame() OVERRIDE; |
46 virtual gfx::NativeWindow GetNativeHandle() OVERRIDE; | 43 virtual gfx::NativeWindow GetNativeHandle() OVERRIDE; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 138 |
142 #ifdef UNIT_TEST | 139 #ifdef UNIT_TEST |
143 NativePanel* native_panel() { return native_panel_; } | 140 NativePanel* native_panel() { return native_panel_; } |
144 #endif | 141 #endif |
145 | 142 |
146 protected: | 143 protected: |
147 virtual void DestroyBrowser() OVERRIDE; | 144 virtual void DestroyBrowser() OVERRIDE; |
148 | 145 |
149 private: | 146 private: |
150 friend class PanelManager; | 147 friend class PanelManager; |
| 148 friend class PanelManagerWin; |
151 | 149 |
152 // Panel can only be created using PanelManager::CreatePanel(). | 150 // Panel can only be created using PanelManager::CreatePanel(). |
153 Panel(Browser* browser, const gfx::Rect& bounds); | 151 Panel(Browser* browser, const gfx::Rect& bounds); |
154 | 152 |
155 // This is different from BrowserWindow::SetBounds(): | 153 // This is different from BrowserWindow::SetBounds(): |
156 // * SetPanelBounds() is only called by PanelManager to manage its position. | 154 // * SetPanelBounds() is only called by PanelManager to manage its position. |
157 // * SetBounds() is called by the API to try to change the bounds, which is | 155 // * SetBounds() is called by the API to try to change the bounds, which is |
158 // not allowed for Panel. | 156 // not allowed for Panel. |
159 void SetPanelBounds(const gfx::Rect& bounds); | 157 void SetPanelBounds(const gfx::Rect& bounds); |
160 | 158 |
| 159 void Minimize(); |
| 160 void Restore(bool titlebar_only); |
| 161 |
161 // Platform specifc implementation for panels. It'd be one of | 162 // Platform specifc implementation for panels. It'd be one of |
162 // PanelBrowserWindowGtk/PanelBrowserView/PanelBrowserWindowCocoa. | 163 // PanelBrowserWindowGtk/PanelBrowserView/PanelBrowserWindowCocoa. |
163 NativePanel* native_panel_; // Weak, owns us. | 164 NativePanel* native_panel_; // Weak, owns us. |
164 | 165 |
165 DISALLOW_COPY_AND_ASSIGN(Panel); | 166 DISALLOW_COPY_AND_ASSIGN(Panel); |
166 }; | 167 }; |
167 | 168 |
168 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ | 169 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ |
OLD | NEW |