summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-31 21:02:22 +0000
committerbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-31 21:02:22 +0000
commitb97675f4c7d3c951145ded0a60223ed3bb3193b7 (patch)
treebd4060cb351c89125c126995ba630083f5504926 /chrome
parentae607dc8ef50d1ccdbc459d3793f9c6b40408dd7 (diff)
downloadchromium_src-b97675f4c7d3c951145ded0a60223ed3bb3193b7.zip
chromium_src-b97675f4c7d3c951145ded0a60223ed3bb3193b7.tar.gz
chromium_src-b97675f4c7d3c951145ded0a60223ed3bb3193b7.tar.bz2
Fix issue where debugger wasn't showing its contents.
Since the debugger window hosts a HWND, it should be initialized when the DebuggerView is inserted into the hierarchy, such that it gets sized properly. Also the DebuggerView needed to propagate changes to its own bounds into the inner view. Also fixes a DCHECK in NavigationController that wasn't handling the existence of the debugger. B=1302810 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/debugger/debugger_view.cc14
-rw-r--r--chrome/browser/debugger/debugger_view.h5
-rw-r--r--chrome/browser/debugger/debugger_window.cc1
-rw-r--r--chrome/browser/navigation_controller_base.cc3
4 files changed, 20 insertions, 3 deletions
diff --git a/chrome/browser/debugger/debugger_view.cc b/chrome/browser/debugger/debugger_view.cc
index be711f0..b594861 100644
--- a/chrome/browser/debugger/debugger_view.cc
+++ b/chrome/browser/debugger/debugger_view.cc
@@ -72,6 +72,20 @@ void DebuggerView::Layout() {
web_container_->SetBounds(0, 0, GetWidth(), GetHeight());
}
+void DebuggerView::DidChangeBounds(const CRect& previous,
+ const CRect& current) {
+ Layout();
+}
+
+void DebuggerView::ViewHierarchyChanged(bool is_add,
+ ChromeViews::View* parent,
+ ChromeViews::View* child) {
+ if (is_add && child == this) {
+ DCHECK(GetViewContainer());
+ OnInit();
+ }
+}
+
void DebuggerView::Paint(ChromeCanvas* canvas) {
#ifndef NDEBUG
SkPaint paint;
diff --git a/chrome/browser/debugger/debugger_view.h b/chrome/browser/debugger/debugger_view.h
index aaa372c..f866651 100644
--- a/chrome/browser/debugger/debugger_view.h
+++ b/chrome/browser/debugger/debugger_view.h
@@ -75,6 +75,10 @@ class DebuggerView : public ChromeViews::View,
virtual void GetPreferredSize(CSize* out);
virtual void Layout();
virtual void Paint(ChromeCanvas* canvas);
+ virtual void DidChangeBounds(const CRect& previous, const CRect& current);
+ virtual void ViewHierarchyChanged(bool is_add,
+ ChromeViews::View* parent,
+ ChromeViews::View* child);
// Overridden from PageNavigator (TabContentsDelegate's base interface):
virtual void OpenURLFromTab(TabContents* source,
@@ -105,7 +109,6 @@ class DebuggerView : public ChromeViews::View,
private:
void ExecuteJavascript(const std::string& js);
- DebuggerWindow* window_;
ChromeFont font_;
WebContents* web_contents_;
TabContentsContainerView* web_container_;
diff --git a/chrome/browser/debugger/debugger_window.cc b/chrome/browser/debugger/debugger_window.cc
index d9842c2..eb6e812 100644
--- a/chrome/browser/debugger/debugger_window.cc
+++ b/chrome/browser/debugger/debugger_window.cc
@@ -63,7 +63,6 @@ void DebuggerWindow::Show(TabContents* tab) {
}
view_ = new DebuggerView();
window_ = ChromeViews::Window::CreateChromeWindow(NULL, gfx::Rect(), this);
- view_->OnInit();
window_->Show();
view_->OnShow();
debugger_ready_ = true;
diff --git a/chrome/browser/navigation_controller_base.cc b/chrome/browser/navigation_controller_base.cc
index b4b3e99..3216bc9 100644
--- a/chrome/browser/navigation_controller_base.cc
+++ b/chrome/browser/navigation_controller_base.cc
@@ -86,7 +86,8 @@ int NavigationControllerBase::GetEntryIndexWithPageID(
type != TAB_CONTENTS_NEW_TAB_UI &&
type != TAB_CONTENTS_ABOUT_UI &&
type != TAB_CONTENTS_HTML_DIALOG &&
- type != TAB_CONTENTS_VIEW_SOURCE)
+ type != TAB_CONTENTS_VIEW_SOURCE &&
+ type != TAB_CONTENTS_DEBUGGER)
DCHECK(instance == NULL);
for (int i = static_cast<int>(entries_.size()) - 1; i >= 0; --i) {