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

Unified Diff: ui/aura/window.cc

Issue 8508009: Debugging code to print layer tree (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « no previous file | ui/gfx/compositor/compositor.gyp » ('j') | ui/gfx/compositor/debug_utils.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window.cc
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index 8a4fc4d7035ba9b15eecbd4d8a181581f81f475e..71daf9d97048870cac70c14a9e28f7d34558ba88 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/stl_util.h"
+#include "base/string_util.h"
#include "ui/aura/desktop.h"
#include "ui/aura/desktop_delegate.h"
#include "ui/aura/event.h"
@@ -74,6 +75,18 @@ void Window::Init(ui::Layer::LayerType layer_type) {
layer_.reset(new ui::Layer(Desktop::GetInstance()->compositor(), layer_type));
layer_->SetVisible(false);
layer_->set_delegate(this);
+#if !defined(NDEBUG)
tfarina 2011/11/09 14:30:50 #ifndef NDEBUG ? one or the other for consistency?
+ std::string layer_name(name());
+ if (layer_name.size() == 0)
tfarina 2011/11/09 14:30:50 size() == 0 -> empty()
+ layer_name.append("Unnamed Window");
+
+ if (id() != -1) {
+ char id_buf[10];
+ base::snprintf(id_buf, sizeof(id_buf), " %d", id());
Ben Goodger (Google) 2011/11/09 17:03:52 Can you do all of this in the debug util rather th
pkotwicz 2011/11/09 18:56:02 I could do this. But I would be assuming that the
+ layer_name.append(id_buf);
+ }
+ layer_->set_name(layer_name);
+#endif
}
void Window::SetType(WindowType type) {
« no previous file with comments | « no previous file | ui/gfx/compositor/compositor.gyp » ('j') | ui/gfx/compositor/debug_utils.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698