Chromium Code Reviews| Index: chrome/browser/ui/cocoa/dev_tools_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/dev_tools_controller.mm b/chrome/browser/ui/cocoa/dev_tools_controller.mm |
| index c7a2c11d1f111b6872f563789ce3e205569ec99f..26da1f709067cab22cd362c01f90ce8271a81a1b 100644 |
| --- a/chrome/browser/ui/cocoa/dev_tools_controller.mm |
| +++ b/chrome/browser/ui/cocoa/dev_tools_controller.mm |
| @@ -19,12 +19,9 @@ |
| namespace { |
| -// Default offset of the contents splitter in pixels. |
| -const int kDefaultContentsSplitOffset = 400; |
| - |
| -// Never make the web part of the tab contents smaller than this (needed if the |
| -// window is only a few pixels high). |
| -const int kMinWebHeight = 50; |
| +// Minimal height of devtools pane or content pane when devtools are docked |
| +// to the browser window. |
| +const int kMinDevToolsHeight = 50; |
| } // end namespace |
| @@ -100,10 +97,9 @@ const int kMinWebHeight = 50; |
| // Load the default split offset. |
| splitOffset = profile->GetPrefs()-> |
| GetInteger(prefs::kDevToolsSplitLocation); |
| - if (splitOffset < 0) { |
| - // Initial load, set to default value. |
| - splitOffset = kDefaultContentsSplitOffset; |
| - } |
| + if (splitOffset < 0) |
| + splitOffset = NSHeight([[subviews objectAtIndex:0] frame]) * 2 / 3; |
| + |
| [splitView_ addSubview:[contentsController_ view]]; |
| } else { |
| DCHECK_EQ([subviews count], 2u); |
| @@ -112,9 +108,10 @@ const int kMinWebHeight = 50; |
| } |
| // Make sure |splitOffset| isn't too large or too small. |
| - splitOffset = std::max(static_cast<CGFloat>(kMinWebHeight), splitOffset); |
| - splitOffset = |
| - std::min(splitOffset, NSHeight([splitView_ frame]) - kMinWebHeight); |
| + splitOffset = std::max(static_cast<CGFloat>(kMinDevToolsHeight), |
|
yurys
2011/06/08 08:14:27
Use of the kMinDevToolsHeight here is confusing, c
|
| + splitOffset); |
| + splitOffset = std::min(NSHeight([splitView_ frame]) - kMinDevToolsHeight, |
|
yurys
2011/06/08 08:14:27
What is the expected behavior when splitOffset her
|
| + splitOffset); |
| DCHECK_GE(splitOffset, 0) << "kMinWebHeight needs to be smaller than " |
| << "smallest available tab contents space."; |