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

Unified Diff: services/ui/view_manager/view_tree_state.cc

Issue 1552043002: Make Mozart view manager use the new compositor. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-12
Patch Set: Created 4 years, 12 months 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
Index: services/ui/view_manager/view_tree_state.cc
diff --git a/services/ui/view_manager/view_tree_state.cc b/services/ui/view_manager/view_tree_state.cc
index e236c084f83eedface2abdb0befbf0ac09ca3436..31c42975f8050c1ca3e9f42377bd58a9a850c765 100644
--- a/services/ui/view_manager/view_tree_state.cc
+++ b/services/ui/view_manager/view_tree_state.cc
@@ -2,19 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/logging.h"
#include "services/ui/view_manager/view_tree_state.h"
+#include "base/logging.h"
+
namespace view_manager {
-ViewTreeState::ViewTreeState(mojo::ui::ViewTreePtr view_tree)
+ViewTreeState::ViewTreeState(mojo::ui::ViewTreePtr view_tree,
+ mojo::ui::ViewTreeTokenPtr view_tree_token,
+ const std::string& label)
: view_tree_(view_tree.Pass()),
- root_(nullptr),
- explicit_root_(false),
- layout_request_pending_(false),
- layout_request_issued_(false),
+ view_tree_token_(view_tree_token.Pass()),
+ label_(label),
weak_factory_(this) {
DCHECK(view_tree_);
+ DCHECK(view_tree_token_);
}
ViewTreeState::~ViewTreeState() {}
@@ -35,4 +37,22 @@ void ViewTreeState::ResetRoot() {
root_ = nullptr;
}
+std::string ViewTreeState::FormattedLabel() {
+ if (formatted_label_cache_.empty()) {
+ std::ostringstream s;
+ s << "<" << view_tree_token_->value;
+ if (!label_.empty())
+ s << ":" << label_;
+ s << ">";
+ formatted_label_cache_ = s.str();
+ }
+ return formatted_label_cache_;
+}
+
+std::ostream& operator<<(std::ostream& os, ViewTreeState* view_tree_state) {
+ if (!view_tree_state)
+ return os << "null";
+ return os << view_tree_state->FormattedLabel();
+}
+
} // namespace view_manager
« services/ui/view_manager/view_tree_state.h ('K') | « services/ui/view_manager/view_tree_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698