Index: services/ui/ws/server_window.cc |
diff --git a/services/ui/ws/server_window.cc b/services/ui/ws/server_window.cc |
index ad93327070e5dbf753b81401ef548a98ee115f0f..d2c781aa34f51411b81881f7983bdb20a916d25b 100644 |
--- a/services/ui/ws/server_window.cc |
+++ b/services/ui/ws/server_window.cc |
@@ -381,21 +381,25 @@ void ServerWindow::SetUnderlayOffset(const gfx::Vector2d& offset) { |
delegate_->OnScheduleWindowPaint(this); |
} |
-#if !defined(NDEBUG) |
+#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) |
std::string ServerWindow::GetDebugWindowHierarchy() const { |
std::string result; |
BuildDebugInfo(std::string(), &result); |
return result; |
} |
-void ServerWindow::BuildDebugInfo(const std::string& depth, |
- std::string* result) const { |
+std::string ServerWindow::GetDebugWindowInfo() const { |
std::string name = GetName(); |
- *result += base::StringPrintf( |
- "%sid=%d,%d visible=%s bounds=%d,%d %dx%d %s\n", depth.c_str(), |
- static_cast<int>(id_.client_id), static_cast<int>(id_.window_id), |
+ return base::StringPrintf( |
+ "id=%s visible=%s bounds=%d,%d %dx%d %s", id_.ToString().c_str(), |
visible_ ? "true" : "false", bounds_.x(), bounds_.y(), bounds_.width(), |
bounds_.height(), !name.empty() ? name.c_str() : "(no name)"); |
+} |
+ |
+void ServerWindow::BuildDebugInfo(const std::string& depth, |
+ std::string* result) const { |
+ *result += |
+ base::StringPrintf("%s%s\n", depth.c_str(), GetDebugWindowInfo().c_str()); |
for (const ServerWindow* child : children_) |
child->BuildDebugInfo(depth + " ", result); |
} |