OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "services/ui/launcher/launcher_view_tree.h" | 5 #include "services/ui/launcher/launcher_view_tree.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "mojo/public/cpp/application/connect.h" | 8 #include "mojo/public/cpp/application/connect.h" |
9 #include "mojo/services/gfx/composition/cpp/formatting.h" | 9 #include "mojo/services/gfx/composition/cpp/formatting.h" |
10 #include "mojo/services/ui/views/cpp/formatting.h" | 10 #include "mojo/services/ui/views/cpp/formatting.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 view_tree_->SetRenderer(renderer.Pass()); | 47 view_tree_->SetRenderer(renderer.Pass()); |
48 } | 48 } |
49 | 49 |
50 LauncherViewTree::~LauncherViewTree() {} | 50 LauncherViewTree::~LauncherViewTree() {} |
51 | 51 |
52 void LauncherViewTree::SetRoot(mojo::ui::ViewOwnerPtr owner) { | 52 void LauncherViewTree::SetRoot(mojo::ui::ViewOwnerPtr owner) { |
53 if (owner) { | 53 if (owner) { |
54 view_tree_->SetRoot(++root_key_, owner.Pass()); | 54 view_tree_->SetRoot(++root_key_, owner.Pass()); |
55 root_was_set_ = true; | 55 root_was_set_ = true; |
56 } else { | 56 } else { |
57 view_tree_->ResetRoot(nullptr); | 57 view_tree_->ClearRoot(nullptr); |
58 root_was_set_ = false; | 58 root_was_set_ = false; |
59 } | 59 } |
60 root_layout_info_.reset(); | 60 root_layout_info_.reset(); |
61 } | 61 } |
62 | 62 |
63 void LauncherViewTree::SetViewportMetrics( | 63 void LauncherViewTree::SetViewportMetrics( |
64 mojo::ViewportMetricsPtr viewport_metrics) { | 64 mojo::ViewportMetricsPtr viewport_metrics) { |
65 viewport_metrics_ = viewport_metrics.Pass(); | 65 viewport_metrics_ = viewport_metrics.Pass(); |
66 view_tree_->RequestLayout(); | 66 view_tree_->RequestLayout(); |
67 } | 67 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 << ", scene_token.value=" << info->scene_token->value; | 131 << ", scene_token.value=" << info->scene_token->value; |
132 | 132 |
133 root_layout_info_ = info.Pass(); | 133 root_layout_info_ = info.Pass(); |
134 } | 134 } |
135 | 135 |
136 void LauncherViewTree::Shutdown() { | 136 void LauncherViewTree::Shutdown() { |
137 shutdown_callback_.Run(); | 137 shutdown_callback_.Run(); |
138 } | 138 } |
139 | 139 |
140 } // namespace launcher | 140 } // namespace launcher |
OLD | NEW |