| Index: mojo/services/view_manager/server_view.cc
|
| diff --git a/mojo/services/view_manager/server_view.cc b/mojo/services/view_manager/server_view.cc
|
| index 991ab8e0d1f1db3603a852912a86bcbc6585a29a..c741b75ccc1170e472f606a2f71c041cbc0fa375 100644
|
| --- a/mojo/services/view_manager/server_view.cc
|
| +++ b/mojo/services/view_manager/server_view.cc
|
| @@ -4,13 +4,18 @@
|
|
|
| #include "mojo/services/view_manager/server_view.h"
|
|
|
| +#include "base/strings/stringprintf.h"
|
| #include "mojo/services/view_manager/server_view_delegate.h"
|
|
|
| namespace mojo {
|
| namespace service {
|
|
|
| ServerView::ServerView(ServerViewDelegate* delegate, const ViewId& id)
|
| - : delegate_(delegate), id_(id), parent_(NULL), visible_(true), opacity_(1) {
|
| + : delegate_(delegate),
|
| + id_(id),
|
| + parent_(nullptr),
|
| + visible_(false),
|
| + opacity_(1) {
|
| DCHECK(delegate); // Must provide a delegate.
|
| }
|
|
|
| @@ -165,6 +170,25 @@ void ServerView::SetSurfaceId(cc::SurfaceId surface_id) {
|
| delegate_->OnViewSurfaceIdChanged(this);
|
| }
|
|
|
| +#if !defined(NDEBUG)
|
| +std::string ServerView::GetDebugWindowHierarchy() const {
|
| + std::string result;
|
| + BuildDebugInfo(std::string(), &result);
|
| + return result;
|
| +}
|
| +
|
| +void ServerView::BuildDebugInfo(const std::string& depth,
|
| + std::string* result) const {
|
| + *result += base::StringPrintf(
|
| + "%sid=%d,%d visible=%s bounds=%d,%d %dx%d surface_id=%ld\n",
|
| + depth.c_str(), static_cast<int>(id_.connection_id),
|
| + static_cast<int>(id_.view_id), visible_ ? "true" : "false", bounds_.x(),
|
| + bounds_.y(), bounds_.width(), bounds_.height(), surface_id_.id);
|
| + for (const ServerView* child : children_)
|
| + child->BuildDebugInfo(depth + " ", result);
|
| +}
|
| +#endif
|
| +
|
| void ServerView::RemoveImpl(ServerView* view) {
|
| view->parent_ = NULL;
|
| children_.erase(std::find(children_.begin(), children_.end(), view));
|
|
|