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/view_manager/view_registry.h" | 5 #include "services/ui/view_manager/view_registry.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 ViewStub* view_stub = view_stub_weak.get(); | 238 ViewStub* view_stub = view_stub_weak.get(); |
239 if (!view_stub || view_stub->is_unavailable()) | 239 if (!view_stub || view_stub->is_unavailable()) |
240 return; | 240 return; |
241 | 241 |
242 DVLOG(2) << "OnStubSceneCreated: view_state=" << view_stub->state() | 242 DVLOG(2) << "OnStubSceneCreated: view_state=" << view_stub->state() |
243 << ", scene_token=" << scene_token; | 243 << ", scene_token=" << scene_token; |
244 | 244 |
245 // Store the scene token. | 245 // Store the scene token. |
246 DCHECK(view_stub->is_linked()); | 246 DCHECK(view_stub->is_linked()); |
247 view_stub->SetStubSceneToken(scene_token.Clone()); | 247 view_stub->SetStubSceneToken(scene_token.Clone()); |
| 248 if (view_stub->state()) |
| 249 PublishStubScene(view_stub->state()); |
248 | 250 |
249 // Send view info to the container including the scene token. | 251 // Send view info to the container including the scene token. |
250 auto view_info = mojo::ui::ViewInfo::New(); | 252 auto view_info = mojo::ui::ViewInfo::New(); |
251 view_info->scene_token = scene_token.Pass(); | 253 view_info->scene_token = scene_token.Pass(); |
252 if (view_stub->container()) { | 254 if (view_stub->container()) { |
253 SendChildAttached(view_stub->container(), view_stub->key(), | 255 SendChildAttached(view_stub->container(), view_stub->key(), |
254 view_info.Pass()); | 256 view_info.Pass()); |
255 } | 257 } |
256 | 258 |
257 // If this is the root of the tree, update the renderer now that we | 259 // If this is the root of the tree, update the renderer now that we |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 auto it = views_by_token_.find(view_token_value); | 767 auto it = views_by_token_.find(view_token_value); |
766 return it != views_by_token_.end() ? it->second : nullptr; | 768 return it != views_by_token_.end() ? it->second : nullptr; |
767 } | 769 } |
768 | 770 |
769 ViewTreeState* ViewRegistry::FindViewTree(uint32_t view_tree_token_value) { | 771 ViewTreeState* ViewRegistry::FindViewTree(uint32_t view_tree_token_value) { |
770 auto it = view_trees_by_token_.find(view_tree_token_value); | 772 auto it = view_trees_by_token_.find(view_tree_token_value); |
771 return it != view_trees_by_token_.end() ? it->second : nullptr; | 773 return it != view_trees_by_token_.end() ? it->second : nullptr; |
772 } | 774 } |
773 | 775 |
774 } // namespace view_manager | 776 } // namespace view_manager |
OLD | NEW |