Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Unified Diff: chrome/browser/ui/panels/panel.h

Issue 8602007: Panels: Disable auto-resize if initial size is specified during creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use golden ratio Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/panels/base_panel_browser_test.cc ('k') | chrome/browser/ui/panels/panel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel.h
diff --git a/chrome/browser/ui/panels/panel.h b/chrome/browser/ui/panels/panel.h
index 64ff50c78eefb25575e497014a1db6e8acb42930..b2cd9482dd26e2c5b5296ec9120bbd310eac2b48 100644
--- a/chrome/browser/ui/panels/panel.h
+++ b/chrome/browser/ui/panels/panel.h
@@ -204,6 +204,7 @@ class Panel : public BrowserWindow,
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_; }
+ bool auto_resizable() const { return auto_resizable_; }
protected:
virtual void DestroyBrowser() OVERRIDE;
@@ -214,7 +215,11 @@ class Panel : public BrowserWindow,
FRIEND_TEST_ALL_PREFIXES(PanelBrowserTest, RestoredBounds);
// Panel can only be created using PanelManager::CreatePanel().
- Panel(Browser* browser, const gfx::Rect& bounds);
+ Panel(Browser* browser,
+ const gfx::Rect& bounds,
+ const gfx::Size& min_size,
+ const gfx::Size& max_size,
+ bool auto_resizable);
// This is different from BrowserWindow::SetBounds():
// * SetPanelBounds() is only called by PanelManager to manage its position.
@@ -222,13 +227,18 @@ class Panel : public BrowserWindow,
// not allowed for Panel.
void SetPanelBounds(const gfx::Rect& bounds);
- // Updates the maximum size.
- void SetMaxSize(const gfx::Size& max_size);
+ // Sets whether the panel will auto resize according to its content.
+ void SetAutoResizable(bool resizable);
// NULL might be returned if the tab has not been added.
RenderViewHost* GetRenderViewHost() const;
- void EnableAutoResize(RenderViewHost* render_view_host);
+ // Configures the tab contents for auto resize, including configurations
+ // on the renderer and detecting renderer changes.
+ void EnableTabContentsAutoResize(TabContents* tab_contents);
+
+ // Configures the renderer for auto resize.
+ void EnableRendererAutoResize(RenderViewHost* render_view_host);
// Requests RenderViewHost not to show the scrollbars till |max_size_| since
// the panel can grow to |max_size_|.
@@ -242,6 +252,9 @@ class Panel : public BrowserWindow,
// the growing content and WebKit would add the scrollbars in such case.
gfx::Size max_size_;
+ // True if this panel auto resizes based on content.
+ bool auto_resizable_;
+
// Platform specifc implementation for panels. It'd be one of
// PanelBrowserWindowGtk/PanelBrowserView/PanelBrowserWindowCocoa.
NativePanel* native_panel_; // Weak, owns us.
« no previous file with comments | « chrome/browser/ui/panels/base_panel_browser_test.cc ('k') | chrome/browser/ui/panels/panel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698