summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-07 14:25:29 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-07 14:25:29 +0000
commitcd4f1227d897deba8372622343c1bf52a5bd6f0f (patch)
tree22d3c7b2dda652e8b795c4cd288cef6192aa21cc
parentf50c5cfe46fd5cd9e106977216eb3e036069eaa7 (diff)
downloadchromium_src-cd4f1227d897deba8372622343c1bf52a5bd6f0f.zip
chromium_src-cd4f1227d897deba8372622343c1bf52a5bd6f0f.tar.gz
chromium_src-cd4f1227d897deba8372622343c1bf52a5bd6f0f.tar.bz2
DevTools: store devtools split offset only when devtools is being hidden.
Otherwise any browser window closed afterwards will overwrite settings with the original ones. Review URL: http://codereview.chromium.org/155140 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20026 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/views/frame/browser_view.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index fcc2318..a0e0bf1 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -602,9 +602,6 @@ void BrowserView::Close() {
for (; bubble != browser_bubbles_.end(); ++bubble) {
(*bubble)->BrowserWindowClosed();
}
-
- g_browser_process->local_state()->SetInteger(
- prefs::kDevToolsSplitLocation, contents_split_->divider_offset());
}
void BrowserView::Activate() {
@@ -1436,6 +1433,7 @@ void BrowserView::Init() {
contents_container_ = new TabContentsContainer;
devtools_container_ = new TabContentsContainer;
+ devtools_container_->SetVisible(false);
contents_split_ = new views::SingleSplitView(
contents_container_,
devtools_container_,
@@ -1607,6 +1605,11 @@ void BrowserView::UpdateDevToolsForContents(TabContents* tab_contents) {
TabContents* devtools_contents =
DevToolsWindow::GetDevToolsContents(tab_contents);
devtools_container_->ChangeTabContents(devtools_contents);
+ if (!devtools_contents && devtools_container_->IsVisible()) {
+ // Store split offset when hiding devtools window only.
+ g_browser_process->local_state()->SetInteger(
+ prefs::kDevToolsSplitLocation, contents_split_->divider_offset());
+ }
devtools_container_->SetVisible(devtools_contents != NULL);
contents_split_->Layout();
}