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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // Construct a native panel BrowserWindow implementation for the specified | 188 // Construct a native panel BrowserWindow implementation for the specified |
189 // |browser|. | 189 // |browser|. |
190 static NativePanel* CreateNativePanel(Browser* browser, | 190 static NativePanel* CreateNativePanel(Browser* browser, |
191 Panel* panel, | 191 Panel* panel, |
192 const gfx::Rect& bounds); | 192 const gfx::Rect& bounds); |
193 | 193 |
194 // Gets the extension from the browser that a panel is created from. | 194 // Gets the extension from the browser that a panel is created from. |
195 // Returns NULL if it cannot be found. | 195 // Returns NULL if it cannot be found. |
196 static const Extension* GetExtensionFromBrowser(Browser* browser); | 196 static const Extension* GetExtensionFromBrowser(Browser* browser); |
197 | 197 |
198 // Used on platforms where the panel cannot determine its window size | |
199 // until the window has been created. (e.g. GTK) | |
200 void OnWindowSizeAvailable(); | |
201 | |
202 // Asynchronous completion of panel close request. | 198 // Asynchronous completion of panel close request. |
203 void OnNativePanelClosed(); | 199 void OnNativePanelClosed(); |
204 | 200 |
205 NativePanel* native_panel() { return native_panel_; } | 201 NativePanel* native_panel() { return native_panel_; } |
206 Browser* browser() const; | 202 Browser* browser() const; |
207 ExpansionState expansion_state() const { return expansion_state_; } | 203 ExpansionState expansion_state() const { return expansion_state_; } |
208 const gfx::Size& min_size() const { return min_size_; } | 204 const gfx::Size& min_size() const { return min_size_; } |
209 const gfx::Size& max_size() const { return max_size_; } | 205 const gfx::Size& max_size() const { return max_size_; } |
210 bool auto_resizable() const { return auto_resizable_; } | 206 bool auto_resizable() const { return auto_resizable_; } |
211 | 207 |
(...skipping 24 matching lines...) Expand all Loading... |
236 // NULL might be returned if the tab has not been added. | 232 // NULL might be returned if the tab has not been added. |
237 RenderViewHost* GetRenderViewHost() const; | 233 RenderViewHost* GetRenderViewHost() const; |
238 | 234 |
239 // Configures the tab contents for auto resize, including configurations | 235 // Configures the tab contents for auto resize, including configurations |
240 // on the renderer and detecting renderer changes. | 236 // on the renderer and detecting renderer changes. |
241 void EnableTabContentsAutoResize(TabContents* tab_contents); | 237 void EnableTabContentsAutoResize(TabContents* tab_contents); |
242 | 238 |
243 // Configures the renderer for auto resize. | 239 // Configures the renderer for auto resize. |
244 void EnableRendererAutoResize(RenderViewHost* render_view_host); | 240 void EnableRendererAutoResize(RenderViewHost* render_view_host); |
245 | 241 |
246 // Requests RenderViewHost not to show the scrollbars till |max_size_| since | |
247 // the panel can grow to |max_size_|. | |
248 void RequestRenderViewHostToDisableScrollbars( | |
249 RenderViewHost* render_view_host); | |
250 | |
251 // This is the minimum size that the panel can shrink to. | 242 // This is the minimum size that the panel can shrink to. |
252 gfx::Size min_size_; | 243 gfx::Size min_size_; |
253 | 244 |
254 // This is the size beyond which the panel is not going to grow to accomodate | 245 // This is the size beyond which the panel is not going to grow to accomodate |
255 // the growing content and WebKit would add the scrollbars in such case. | 246 // the growing content and WebKit would add the scrollbars in such case. |
256 gfx::Size max_size_; | 247 gfx::Size max_size_; |
257 | 248 |
258 // True if this panel auto resizes based on content. | 249 // True if this panel auto resizes based on content. |
259 bool auto_resizable_; | 250 bool auto_resizable_; |
260 | 251 |
261 // Platform specifc implementation for panels. It'd be one of | 252 // Platform specifc implementation for panels. It'd be one of |
262 // PanelBrowserWindowGtk/PanelBrowserView/PanelBrowserWindowCocoa. | 253 // PanelBrowserWindowGtk/PanelBrowserView/PanelBrowserWindowCocoa. |
263 NativePanel* native_panel_; // Weak, owns us. | 254 NativePanel* native_panel_; // Weak, owns us. |
264 | 255 |
265 ExpansionState expansion_state_; | 256 ExpansionState expansion_state_; |
266 | 257 |
267 // Stores the full height of the panel so we can restore it after it's | 258 // Stores the full height of the panel so we can restore it after it's |
268 // been minimized. | 259 // been minimized. |
269 int restored_height_; | 260 int restored_height_; |
270 | 261 |
271 content::NotificationRegistrar registrar_; | 262 content::NotificationRegistrar registrar_; |
272 | 263 |
273 DISALLOW_COPY_AND_ASSIGN(Panel); | 264 DISALLOW_COPY_AND_ASSIGN(Panel); |
274 }; | 265 }; |
275 | 266 |
276 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ | 267 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ |
OLD | NEW |