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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 // Returns the PanelManager associated with this panel. | 52 // Returns the PanelManager associated with this panel. |
53 PanelManager* manager() const; | 53 PanelManager* manager() const; |
54 | 54 |
55 // Gets the extension that a panel is created from. | 55 // Gets the extension that a panel is created from. |
56 // Returns NULL if it cannot be found. | 56 // Returns NULL if it cannot be found. |
57 const Extension* GetExtension() const; | 57 const Extension* GetExtension() const; |
58 | 58 |
59 void SetExpansionState(ExpansionState new_expansion_state); | 59 void SetExpansionState(ExpansionState new_expansion_state); |
60 | 60 |
61 bool ShouldBringUpTitlebar(int mouse_x, int mouse_y) const; | |
62 | |
63 bool IsDrawingAttention() const; | 61 bool IsDrawingAttention() const; |
64 | 62 |
65 // This function will only get called by PanelManager when full screen mode | 63 // This function will only get called by PanelManager when full screen mode |
66 // changes i.e it gets called when an app goes into full screen mode or when | 64 // changes i.e it gets called when an app goes into full screen mode or when |
67 // an app exits full screen mode. Panel should respond by making sure | 65 // an app exits full screen mode. Panel should respond by making sure |
68 // a) it does not go on top when some app enters full screen mode. | 66 // a) it does not go on top when some app enters full screen mode. |
69 // b) it remains on top when an app exits full screen mode. | 67 // b) it remains on top when an app exits full screen mode. |
70 void FullScreenModeChanged(bool is_full_screen); | 68 void FullScreenModeChanged(bool is_full_screen); |
71 | 69 |
72 void MoveOutOfOverflow(); | |
73 | |
74 // Ensures that the panel is fully visible, that is, not obscured by other | 70 // Ensures that the panel is fully visible, that is, not obscured by other |
75 // top-most windows. | 71 // top-most windows. |
76 void EnsureFullyVisible(); | 72 void EnsureFullyVisible(); |
77 | 73 |
78 int TitleOnlyHeight() const; | 74 int TitleOnlyHeight() const; |
79 | 75 |
80 // Returns the size of the panel when it is iconified, as shown on the | 76 // Returns the size of the panel when it is iconified, as shown on the |
81 // overflow area. | 77 // overflow area. |
82 gfx::Size IconOnlySize() const; | 78 gfx::Size IconOnlySize() const; |
83 | 79 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 237 |
242 // Updates the panel bounds instantly without any animation. | 238 // Updates the panel bounds instantly without any animation. |
243 void SetPanelBoundsInstantly(const gfx::Rect& bounds); | 239 void SetPanelBoundsInstantly(const gfx::Rect& bounds); |
244 | 240 |
245 // Sets whether the panel will auto resize according to its content. | 241 // Sets whether the panel will auto resize according to its content. |
246 void SetAutoResizable(bool resizable); | 242 void SetAutoResizable(bool resizable); |
247 | 243 |
248 // Sets minimum and maximum size for the panel. | 244 // Sets minimum and maximum size for the panel. |
249 void SetSizeRange(const gfx::Size& min_size, const gfx::Size& max_size); | 245 void SetSizeRange(const gfx::Size& min_size, const gfx::Size& max_size); |
250 | 246 |
| 247 // Sets whether the panel app icon is visible in the taskbar. |
| 248 void SetAppIconVisibility(bool visible); |
| 249 |
| 250 // Newly created panels may be placed in a temporary layout until their |
| 251 // final position is determined. |
| 252 bool has_temporary_layout() const { return has_temporary_layout_; } |
| 253 void set_has_temporary_layout(bool temporary) { |
| 254 has_temporary_layout_ = temporary; |
| 255 } |
| 256 |
251 protected: | 257 protected: |
252 virtual void DestroyBrowser() OVERRIDE; | 258 virtual void DestroyBrowser() OVERRIDE; |
253 | 259 |
254 private: | 260 private: |
255 friend class PanelManager; | 261 friend class PanelManager; |
256 friend class PanelBrowserTest; | 262 friend class PanelBrowserTest; |
257 FRIEND_TEST_ALL_PREFIXES(PanelBrowserTest, RestoredBounds); | 263 FRIEND_TEST_ALL_PREFIXES(PanelBrowserTest, RestoredBounds); |
258 | 264 |
259 // Panel can only be created using PanelManager::CreatePanel(). | 265 // Panel can only be created using PanelManager::CreatePanel(). |
260 // |requested_size| is the desired size for the panel, but actual | 266 // |requested_size| is the desired size for the panel, but actual |
261 // size may differ after panel layout. | 267 // size may differ after panel layout. |
262 Panel(Browser* browser, const gfx::Size& requested_size); | 268 Panel(Browser* browser, const gfx::Size& requested_size); |
263 | 269 |
264 // Configures the tab contents for auto resize, including configurations | 270 // Configures the tab contents for auto resize, including configurations |
265 // on the renderer and detecting renderer changes. | 271 // on the renderer and detecting renderer changes. |
266 void EnableTabContentsAutoResize(TabContents* tab_contents); | 272 void EnableTabContentsAutoResize(TabContents* tab_contents); |
267 | 273 |
268 // Configures the renderer for auto resize (if auto resize is enabled). | 274 // Configures the renderer for auto resize (if auto resize is enabled). |
269 void ConfigureAutoResize(TabContents* tab_contents); | 275 void ConfigureAutoResize(TabContents* tab_contents); |
270 | 276 |
271 Browser* browser_; // Weak, owned by native panel. | 277 Browser* browser_; // Weak, owned by native panel. |
272 | 278 |
273 bool initialized_; | 279 bool initialized_; |
274 | 280 |
| 281 // Newly created panels may be placed in a temporary layout until their |
| 282 // final position is determined. |
| 283 bool has_temporary_layout_; |
| 284 |
275 // Stores the full size of the panel so we can restore it after it's | 285 // Stores the full size of the panel so we can restore it after it's |
276 // been minimized. | 286 // been minimized. |
277 gfx::Size restored_size_; | 287 gfx::Size restored_size_; |
278 | 288 |
279 // This is the minimum size that the panel can shrink to. | 289 // This is the minimum size that the panel can shrink to. |
280 gfx::Size min_size_; | 290 gfx::Size min_size_; |
281 | 291 |
282 // This is the size beyond which the panel is not going to grow to accomodate | 292 // This is the size beyond which the panel is not going to grow to accomodate |
283 // the growing content and WebKit would add the scrollbars in such case. | 293 // the growing content and WebKit would add the scrollbars in such case. |
284 gfx::Size max_size_; | 294 gfx::Size max_size_; |
285 | 295 |
286 // True if this panel auto resizes based on content. | 296 // True if this panel auto resizes based on content. |
287 bool auto_resizable_; | 297 bool auto_resizable_; |
288 | 298 |
289 // Platform specifc implementation for panels. It'd be one of | 299 // Platform specifc implementation for panels. It'd be one of |
290 // PanelBrowserWindowGtk/PanelBrowserView/PanelBrowserWindowCocoa. | 300 // PanelBrowserWindowGtk/PanelBrowserView/PanelBrowserWindowCocoa. |
291 NativePanel* native_panel_; // Weak, owns us. | 301 NativePanel* native_panel_; // Weak, owns us. |
292 | 302 |
293 ExpansionState expansion_state_; | 303 ExpansionState expansion_state_; |
294 | 304 |
| 305 // Indicates whether the panel app icon is visible in the taskbar. |
| 306 bool app_icon_visible_; |
| 307 |
295 content::NotificationRegistrar registrar_; | 308 content::NotificationRegistrar registrar_; |
296 | 309 |
297 DISALLOW_COPY_AND_ASSIGN(Panel); | 310 DISALLOW_COPY_AND_ASSIGN(Panel); |
298 }; | 311 }; |
299 | 312 |
300 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ | 313 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ |
OLD | NEW |