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

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: comments addressed 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
« no previous file with comments | « chrome/browser/ui/gtk/browser_window_gtk.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 50ad4e5eb49252b52c908ebe1e6ec9cc0986c67d..2b5c0433b971c1b6ffc10ce9490ef9744e51411a 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -131,6 +131,12 @@ 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 = 50;
+const int kMinContentsHeight = 50;
+
// 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 +2154,15 @@ 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;
- }
+ if (split_offset == -1)
+ split_offset = contents_split_->height() * 2 / 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,
+ split_offset);
+ split_offset = std::max(kMinContentsHeight, split_offset);
+ if (split_offset < 0)
+ split_offset = contents_split_->height() * 2 / 3;
contents_split_->set_divider_offset(split_offset);
devtools_container_->SetVisible(true);
« no previous file with comments | « 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