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

Unified Diff: chrome/browser/ui/cocoa/dev_tools_controller.mm

Issue 7121012: DevTools window doesn't restore its minimal size if it's shrinked to zero. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: initial idea was reverted. The new version fix gtk problem, make identical logic for all platforms. Created 9 years, 6 months 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/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..d48cffeb3d6b2d7631473cfca0125ad9c5137ade 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 = 100;
pfeldman 2011/06/07 19:59:12 Please keep it 50.
} // end namespace
@@ -100,10 +97,6 @@ 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;
- }
[splitView_ addSubview:[contentsController_ view]];
} else {
DCHECK_EQ([subviews count], 2u);
@@ -112,9 +105,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),
pfeldman 2011/06/07 19:59:12 One of these should stay kMinWebHeight. I.e. we wh
+ splitOffset);
+ splitOffset = std::min(NSHeight([splitView_ frame]) - kMinDevToolsHeight,
+ splitOffset);
DCHECK_GE(splitOffset, 0) << "kMinWebHeight needs to be smaller than "
<< "smallest available tab contents space.";

Powered by Google App Engine
This is Rietveld 408576698