Chromium Code Reviews| 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) { |