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

Unified Diff: chrome/browser/ui/panels/panel_manager.cc

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: 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
Index: chrome/browser/ui/panels/panel_manager.cc
diff --git a/chrome/browser/ui/panels/panel_manager.cc b/chrome/browser/ui/panels/panel_manager.cc
index f9afd8c6df36e38022ba2655d6ec0cd278b8e1f8..9272a43a9644ef19601feb1c5c970b89d8b5cde6 100644
--- a/chrome/browser/ui/panels/panel_manager.cc
+++ b/chrome/browser/ui/panels/panel_manager.cc
@@ -100,10 +100,13 @@ Panel* PanelManager::CreatePanel(Browser* browser) {
int width = browser->override_bounds().width();
int height = browser->override_bounds().height();
- if (width == 0 && height == 0) {
+ // Auto resizable is enabled only if no initial size is provided.
+ bool auto_resize = !(width || height);
Dmitry Titov 2011/11/18 23:00:34 I think the coding style actually prefers this sty
jianli 2011/11/18 23:03:32 I find it more readable if we say "width = 0 && he
jennb 2011/11/18 23:26:00 Done.
+
+ if (width == 0)
width = kPanelDefaultWidth;
+ if (height == 0)
height = kPanelDefaultHeight;
- }
int max_panel_width = GetMaxPanelWidth();
int max_panel_height = GetMaxPanelHeight();
@@ -124,6 +127,8 @@ Panel* PanelManager::CreatePanel(Browser* browser) {
// Now create the panel with the computed bounds.
Panel* panel = new Panel(browser, gfx::Rect(x, y, width, height));
panel->SetMaxSize(gfx::Size(max_panel_width, max_panel_height));
+ panel->SetMinSize(gfx::Size(kPanelMinWidth, kPanelMinHeight));
+ panel->SetAutoResizable(auto_resize);
panels_.push_back(panel);
content::NotificationService::current()->Notify(
« chrome/browser/ui/panels/panel.cc ('K') | « chrome/browser/ui/panels/panel_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698