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

Unified Diff: services/ui/launcher/launcher_view_tree.cc

Issue 1679023006: Reify view ownership as a message pipe. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « services/ui/launcher/launcher_view_tree.h ('k') | services/ui/view_manager/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/launcher/launcher_view_tree.cc
diff --git a/services/ui/launcher/launcher_view_tree.cc b/services/ui/launcher/launcher_view_tree.cc
index 1c2beb6d6a0327930ca4837b0c4f1a9d403f8492..3763e9b24647e9cbecf58acaa659c0e8e7bfde6d 100644
--- a/services/ui/launcher/launcher_view_tree.cc
+++ b/services/ui/launcher/launcher_view_tree.cc
@@ -48,10 +48,8 @@ LauncherViewTree::LauncherViewTree(
// Register the view tree.
mojo::ui::ViewTreePtr view_tree;
view_tree_binding_.Bind(mojo::GetProxy(&view_tree));
- view_manager_->RegisterViewTree(
- view_tree.Pass(), mojo::GetProxy(&view_tree_host_), "Launcher",
- base::Bind(&LauncherViewTree::OnViewTreeRegistered,
- base::Unretained(this)));
+ view_manager_->RegisterViewTree(view_tree.Pass(),
+ mojo::GetProxy(&view_tree_host_), "Launcher");
view_tree_host_.set_connection_error_handler(base::Bind(
&LauncherViewTree::OnViewTreeConnectionError, base::Unretained(this)));
@@ -68,12 +66,14 @@ LauncherViewTree::LauncherViewTree(
LauncherViewTree::~LauncherViewTree() {}
-void LauncherViewTree::SetRoot(mojo::ui::ViewTokenPtr token) {
- root_ = token.Pass();
- if (root_)
- view_tree_host_->SetRoot(++root_key_, root_.Clone());
- else
- view_tree_host_->ResetRoot();
+void LauncherViewTree::SetRoot(mojo::ui::ViewOwnerPtr owner) {
+ if (owner) {
+ view_tree_host_->SetRoot(++root_key_, owner.Pass());
+ root_was_set_ = true;
+ } else {
+ view_tree_host_->ResetRoot(nullptr);
+ root_was_set_ = false;
+ }
root_layout_info_.reset();
}
@@ -118,11 +118,6 @@ void LauncherViewTree::OnSceneRegistered(
SetRootScene();
}
-void LauncherViewTree::OnViewTreeRegistered(
- mojo::ui::ViewTreeTokenPtr view_tree_token) {
- DVLOG(1) << "OnViewTreeRegistered: view_tree_token=" << view_tree_token;
-}
-
void LauncherViewTree::OnResourceUnavailable(
uint32_t resource_id,
const OnResourceUnavailableCallback& callback) {
@@ -145,7 +140,7 @@ void LauncherViewTree::OnRootUnavailable(
}
void LauncherViewTree::LayoutRoot() {
- if (!root_)
+ if (!root_was_set_)
return;
auto params = mojo::ui::ViewLayoutParams::New();
« no previous file with comments | « services/ui/launcher/launcher_view_tree.h ('k') | services/ui/view_manager/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698