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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

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/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 782450c4d52d759125277251b775af9bc650c1d4..3875a5bfcb9c17d6d6d8ac7ffd6bb29a11fde731 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -131,6 +131,11 @@ static const int kStatusBubbleHeight = 20;
static const char* const kBrowserViewKey = "__BROWSER_VIEW__";
// How frequently we check for hung plugin windows.
static const int kDefaultHungPluginDetectFrequency = 2000;
+
+// Minimal height of devtools pane or content pane when devtools are docked
+// to the browser window.
+const int kMinDevToolsHeight = 100;
+
// How long do we wait before we consider a window hung (in ms).
static const int kDefaultPluginMessageResponseTimeout = 30000;
// The number of milliseconds between loading animation frames.
@@ -2148,14 +2153,9 @@ void BrowserView::UpdateDevToolsForContents(TabContentsWrapper* wrapper) {
// Restore split offset.
int split_offset = browser_->profile()->GetPrefs()->
GetInteger(prefs::kDevToolsSplitLocation);
- if (split_offset == -1) {
- // Initial load, set to default value.
- split_offset = 2 * contents_split_->height() / 3;
- }
// Make sure user can see both panes.
- int min_split_size = contents_split_->height() / 10;
- split_offset = std::min(contents_split_->height() - min_split_size,
- std::max(min_split_size, split_offset));
+ split_offset = std::min(contents_split_->height() - kMinDevToolsHeight,
+ std::max(kMinDevToolsHeight, split_offset));
pfeldman 2011/06/07 20:14:51 While I agree that 50 is a good threshold for the
contents_split_->set_divider_offset(split_offset);
devtools_container_->SetVisible(true);
« chrome/browser/ui/gtk/browser_window_gtk.cc ('K') | « chrome/browser/ui/gtk/browser_window_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698