From 36de1cbdf69c7bfba95f5b7c200e8ca78f1b9f9d Mon Sep 17 00:00:00 2001 From: "vollick@chromium.org" Date: Tue, 20 Sep 2011 20:47:07 +0000 Subject: Improvements to debugging code which prints the views hierarchy. BUG=None TEST=None Review URL: http://codereview.chromium.org/7906015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102011 0039d316-1c4b-4281-b951-d872f2087c98 --- views/view.h | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'views/view.h') diff --git a/views/view.h b/views/view.h index a9cf33a..2ebd832 100644 --- a/views/view.h +++ b/views/view.h @@ -1078,6 +1078,22 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, static int GetHorizontalDragThreshold(); static int GetVerticalDragThreshold(); + // Debugging ----------------------------------------------------------------- + +#if !defined(NDEBUG) + // Returns string containing a graph of the views hierarchy in graphViz DOT + // language (http://graphviz.org/). Can be called within debugger and save + // to a file to compile/view. + // Note: Assumes initial call made with first = true. + virtual std::string PrintViewGraph(bool first); + + // Some classes may own an object which contains the children to displayed in + // the views hierarchy. The above function gives the class the flexibility to + // decide which object should be used to obtain the children, but this + // function makes the decision explicit. + std::string DoPrintViewGraph(bool first, View* view_with_children); +#endif + private: friend class internal::NativeWidgetView; friend class internal::RootView; @@ -1296,16 +1312,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, // supported drag operations. When done, OnDragDone is invoked. void DoDrag(const MouseEvent& event, const gfx::Point& press_pt); - // Debugging ----------------------------------------------------------------- - -#if defined(TOUCH_DEBUG) - // Returns string containing a graph of the views hierarchy in graphViz DOT - // language (http://graphviz.org/). Can be called within debugger and save - // to a file to compile/view. - // Note: Assumes initial call made with first = true. - std::string PrintViewGraph(bool first); -#endif - ////////////////////////////////////////////////////////////////////////////// // Creation and lifetime ----------------------------------------------------- -- cgit v1.1