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

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: Changes as requested 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.cc » ('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 d1caa0416e6eab3ea3e35464644793eef6d29341..a35fba055b3c988ce1957875fa36b83647c27f3f 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/client/stacking_client.h"
#include "ui/aura/desktop.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 ndef NDEBUG
tfarina 2011/11/11 18:46:28 nit: #ifndef
Ben Goodger (Google) 2011/11/14 22:59:09 mostly we do !defined()
+ std::string layer_name(name());
tfarina 2011/11/11 18:46:28 nit: name() -> name_
+ if (layer_name.empty())
+ layer_name.append("Unnamed Window");
+
+ if (id() != -1) {
tfarina 2011/11/11 18:46:28 nit: id() -> id_
+ char id_buf[10];
+ base::snprintf(id_buf, sizeof(id_buf), " %d", id());
tfarina 2011/11/11 18:46:28 nit: id() -> id_
+ layer_name.append(id_buf);
Ben Goodger (Google) 2011/11/14 22:59:09 I agree with tfarina's nits here, prevalent style
+ }
+ 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.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698