Chromium Code Reviews| Index: chrome/browser/ui/panels/panel.h |
| =================================================================== |
| --- chrome/browser/ui/panels/panel.h (revision 95921) |
| +++ chrome/browser/ui/panels/panel.h (working copy) |
| @@ -9,10 +9,13 @@ |
| #include "chrome/browser/ui/browser_window.h" |
| #include "base/memory/scoped_ptr.h" |
| +#include "content/common/notification_observer.h" |
| +#include "content/common/notification_registrar.h" |
| #include "ui/gfx/rect.h" |
| class NativePanel; |
| class PanelManager; |
| +class RenderViewHost; |
| // A platform independent implementation of BrowserWindow for Panels. This |
| // class would get the first crack at all the BrowserWindow calls for Panels and |
| @@ -24,7 +27,7 @@ |
| // Panel size is restricted to certain limits. |
| // - Invoke an appropriate PanelManager function to do stuff that might affect |
| // other Panels. For example deleting a panel would rearrange other panels. |
| -class Panel : public BrowserWindow { |
| +class Panel : public BrowserWindow, public NotificationObserver { |
| public: |
| enum ExpansionState { |
| // The panel is fully expanded with both title-bar and the client-area. |
| @@ -46,6 +49,11 @@ |
| bool IsDrawingAttention() const; |
| + // Gets or sets the restored height, which is the full height of the panel |
| + // when it is expanded. |
| + int GetRestoredHeight() const; |
|
Dmitry Titov
2011/08/09 21:08:16
I wonder why don't we just let PanelManager to get
jianli
2011/08/09 22:15:49
Personally I would like PanelManager to know nothi
|
| + void SetRestoredHeight(int height); |
| + |
| // BrowserWindow overrides. |
| virtual void Show() OVERRIDE; |
| virtual void ShowInactive() OVERRIDE; |
| @@ -144,7 +152,13 @@ |
| #if defined(OS_CHROMEOS) |
| virtual void ShowKeyboardOverlay(gfx::NativeWindow owning_window) OVERRIDE; |
| #endif |
| + virtual void UpdatePreferredSize(const gfx::Size& pref_size) OVERRIDE; |
| + // NotificationObserver overrides. |
| + virtual void Observe(int type, |
| + const NotificationSource& source, |
| + const NotificationDetails& details) OVERRIDE; |
| + |
| // Construct a native panel BrowserWindow implementation for the specified |
| // |browser|. |
| static NativePanel* CreateNativePanel(Browser* browser, |
| @@ -161,6 +175,8 @@ |
| Browser* browser() const; |
| ExpansionState expansion_state() const { return expansion_state_; } |
| + const gfx::Size& min_size() const { return min_size_; } |
| + const gfx::Size& max_size() const { return max_size_; } |
| protected: |
| virtual void DestroyBrowser() OVERRIDE; |
| @@ -177,12 +193,27 @@ |
| // not allowed for Panel. |
| void SetPanelBounds(const gfx::Rect& bounds); |
| + // Updates the maximum size. |
| + void SetMaxSize(const gfx::Size& max_size); |
| + |
| + void RequestRenderViewHostToDisableScrollbars( |
| + RenderViewHost* render_view_host); |
| + |
| + // This is the minimum size that the panel can shrink to. |
| + gfx::Size min_size_; |
| + |
| + // This is the size beyond which the panel is not going to grow to accomodate |
| + // the growing content and WebKit would add the scrollbars in such case. |
| + gfx::Size max_size_; |
| + |
| // Platform specifc implementation for panels. It'd be one of |
| // PanelBrowserWindowGtk/PanelBrowserView/PanelBrowserWindowCocoa. |
| NativePanel* native_panel_; // Weak, owns us. |
| ExpansionState expansion_state_; |
| + NotificationRegistrar registrar_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(Panel); |
| }; |