| 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_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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 // Sets the current panel strip that contains this panel. | 224 // Sets the current panel strip that contains this panel. |
| 225 void SetPanelStrip(PanelStrip* new_strip); | 225 void SetPanelStrip(PanelStrip* new_strip); |
| 226 | 226 |
| 227 ExpansionState expansion_state() const { return expansion_state_; } | 227 ExpansionState expansion_state() const { return expansion_state_; } |
| 228 ExpansionState old_expansion_state() const { return old_expansion_state_; } | 228 ExpansionState old_expansion_state() const { return old_expansion_state_; } |
| 229 const gfx::Size& min_size() const { return min_size_; } | 229 const gfx::Size& min_size() const { return min_size_; } |
| 230 const gfx::Size& max_size() const { return max_size_; } | 230 const gfx::Size& max_size() const { return max_size_; } |
| 231 bool auto_resizable() const { return auto_resizable_; } | 231 bool auto_resizable() const { return auto_resizable_; } |
| 232 | 232 |
| 233 bool in_preview_mode() const { return in_preview_mode_; } |
| 234 |
| 233 bool draggable() const; | 235 bool draggable() const; |
| 234 | 236 |
| 235 // The restored size is the size of the panel when it is expanded. | 237 // The restored size is the size of the panel when it is expanded. |
| 236 gfx::Size restored_size() const { return restored_size_; } | 238 gfx::Size restored_size() const { return restored_size_; } |
| 237 void set_restored_size(const gfx::Size& size) { restored_size_ = size; } | 239 void set_restored_size(const gfx::Size& size) { restored_size_ = size; } |
| 238 | 240 |
| 239 // Panel must be initialized to be "fully created" and ready for use. | 241 // Panel must be initialized to be "fully created" and ready for use. |
| 240 // Only called by PanelManager. | 242 // Only called by PanelManager. |
| 241 bool initialized() const { return initialized_; } | 243 bool initialized() const { return initialized_; } |
| 242 void Initialize(const gfx::Rect& bounds); | 244 void Initialize(const gfx::Rect& bounds); |
| 243 | 245 |
| 244 // This is different from BrowserWindow::SetBounds(): | 246 // This is different from BrowserWindow::SetBounds(): |
| 245 // * SetPanelBounds() is only called by PanelManager to manage its position. | 247 // * SetPanelBounds() is only called by PanelManager to manage its position. |
| 246 // * SetBounds() is called by the API to try to change the bounds, which is | 248 // * SetBounds() is called by the API to try to change the bounds, which is |
| 247 // not allowed for Panel. | 249 // not allowed for Panel. |
| 248 void SetPanelBounds(const gfx::Rect& bounds); | 250 void SetPanelBounds(const gfx::Rect& bounds); |
| 249 | 251 |
| 250 // Updates the panel bounds instantly without any animation. | 252 // Updates the panel bounds instantly without any animation. |
| 251 void SetPanelBoundsInstantly(const gfx::Rect& bounds); | 253 void SetPanelBoundsInstantly(const gfx::Rect& bounds); |
| 252 | 254 |
| 253 // Sets whether the panel will auto resize according to its content. | 255 // Sets whether the panel will auto resize according to its content. |
| 254 void SetAutoResizable(bool resizable); | 256 void SetAutoResizable(bool resizable); |
| 255 | 257 |
| 256 // Sets minimum and maximum size for the panel. | 258 // Sets minimum and maximum size for the panel. |
| 257 void SetSizeRange(const gfx::Size& min_size, const gfx::Size& max_size); | 259 void SetSizeRange(const gfx::Size& min_size, const gfx::Size& max_size); |
| 258 | 260 |
| 259 // Sets whether the panel app icon is visible in the taskbar. | 261 // Sets whether the panel app icon is visible in the taskbar. |
| 260 void SetAppIconVisibility(bool visible); | 262 void SetAppIconVisibility(bool visible); |
| 261 | 263 |
| 264 // Sets whether the panel window is always on top. |
| 265 void SetAlwaysOnTop(bool on_top); |
| 266 |
| 267 // Sets whether the panel is shown in preview mode. When the panel is |
| 268 // being dragged, it is in preview mode. |
| 269 void SetPreviewMode(bool in_preview_mode); |
| 270 |
| 262 // Newly created panels may be placed in a temporary layout until their | 271 // Newly created panels may be placed in a temporary layout until their |
| 263 // final position is determined. | 272 // final position is determined. |
| 264 bool has_temporary_layout() const { return has_temporary_layout_; } | 273 bool has_temporary_layout() const { return has_temporary_layout_; } |
| 265 void set_has_temporary_layout(bool temporary) { | 274 void set_has_temporary_layout(bool temporary) { |
| 266 has_temporary_layout_ = temporary; | 275 has_temporary_layout_ = temporary; |
| 267 } | 276 } |
| 268 | 277 |
| 269 protected: | 278 protected: |
| 270 virtual void DestroyBrowser() OVERRIDE; | 279 virtual void DestroyBrowser() OVERRIDE; |
| 271 | 280 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 // This is the minimum size that the panel can shrink to. | 314 // This is the minimum size that the panel can shrink to. |
| 306 gfx::Size min_size_; | 315 gfx::Size min_size_; |
| 307 | 316 |
| 308 // This is the size beyond which the panel is not going to grow to accomodate | 317 // This is the size beyond which the panel is not going to grow to accomodate |
| 309 // the growing content and WebKit would add the scrollbars in such case. | 318 // the growing content and WebKit would add the scrollbars in such case. |
| 310 gfx::Size max_size_; | 319 gfx::Size max_size_; |
| 311 | 320 |
| 312 // True if this panel auto resizes based on content. | 321 // True if this panel auto resizes based on content. |
| 313 bool auto_resizable_; | 322 bool auto_resizable_; |
| 314 | 323 |
| 324 // True if this panel should always stay on top of other windows. |
| 325 bool always_on_top_; |
| 326 |
| 327 // True if this panel is in preview mode. When in preview mode, panel bounds |
| 328 // should not be affected by layout refresh. This is currently used by drag |
| 329 // controller to add a panel to the strip without causing its bounds to |
| 330 // change. |
| 331 bool in_preview_mode_; |
| 332 |
| 315 // Platform specifc implementation for panels. It'd be one of | 333 // Platform specifc implementation for panels. It'd be one of |
| 316 // PanelBrowserWindowGtk/PanelBrowserView/PanelBrowserWindowCocoa. | 334 // PanelBrowserWindowGtk/PanelBrowserView/PanelBrowserWindowCocoa. |
| 317 NativePanel* native_panel_; // Weak, owns us. | 335 NativePanel* native_panel_; // Weak, owns us. |
| 318 | 336 |
| 319 ExpansionState expansion_state_; | 337 ExpansionState expansion_state_; |
| 320 ExpansionState old_expansion_state_; | 338 ExpansionState old_expansion_state_; |
| 321 | 339 |
| 322 // Indicates whether the panel app icon is visible in the taskbar. | |
| 323 bool app_icon_visible_; | |
| 324 | |
| 325 content::NotificationRegistrar registrar_; | 340 content::NotificationRegistrar registrar_; |
| 326 | 341 |
| 327 DISALLOW_COPY_AND_ASSIGN(Panel); | 342 DISALLOW_COPY_AND_ASSIGN(Panel); |
| 328 }; | 343 }; |
| 329 | 344 |
| 330 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ | 345 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ |
| OLD | NEW |