OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/services/view_manager/view_manager_init_service_context.h" | 5 #include "mojo/services/view_manager/view_manager_init_service_context.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "mojo/services/view_manager/root_node_manager.h" | 9 #include "mojo/services/view_manager/root_node_manager.h" |
10 #include "mojo/services/view_manager/view_manager_init_service_impl.h" | 10 #include "mojo/services/view_manager/view_manager_init_service_impl.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 ServiceProviderPtr service_provider, | 60 ServiceProviderPtr service_provider, |
61 const Callback<void(bool)>& callback) { | 61 const Callback<void(bool)>& callback) { |
62 ConnectParams* params = new ConnectParams; | 62 ConnectParams* params = new ConnectParams; |
63 params->url = url.To<std::string>(); | 63 params->url = url.To<std::string>(); |
64 params->callback = callback; | 64 params->callback = callback; |
65 params->service_provider.Bind(service_provider.PassMessagePipe()); | 65 params->service_provider.Bind(service_provider.PassMessagePipe()); |
66 connect_params_.push_back(params); | 66 connect_params_.push_back(params); |
67 MaybeEmbed(); | 67 MaybeEmbed(); |
68 } | 68 } |
69 | 69 |
70 void ViewManagerInitServiceContext::OnRootViewManagerWindowTreeHostCreated() { | 70 void ViewManagerInitServiceContext::OnDisplayManagerWindowTreeHostCreated() { |
71 DCHECK(!is_tree_host_ready_); | 71 DCHECK(!is_tree_host_ready_); |
72 is_tree_host_ready_ = true; | 72 is_tree_host_ready_ = true; |
73 MaybeEmbed(); | 73 MaybeEmbed(); |
74 } | 74 } |
75 | 75 |
76 void ViewManagerInitServiceContext::OnNativeViewportDeleted() { | 76 void ViewManagerInitServiceContext::OnNativeViewportDeleted() { |
77 // Prevent the connection from modifying the connection list during manual | 77 // Prevent the connection from modifying the connection list during manual |
78 // teardown. | 78 // teardown. |
79 base::AutoReset<bool> deleting_connection(&deleting_connection_, true); | 79 base::AutoReset<bool> deleting_connection(&deleting_connection_, true); |
80 for (Connections::const_iterator it = connections_.begin(); | 80 for (Connections::const_iterator it = connections_.begin(); |
(...skipping 11 matching lines...) Expand all Loading... |
92 for (ScopedVector<ConnectParams>::const_iterator it = connect_params_.begin(); | 92 for (ScopedVector<ConnectParams>::const_iterator it = connect_params_.begin(); |
93 it != connect_params_.end(); ++it) { | 93 it != connect_params_.end(); ++it) { |
94 root_node_manager_->EmbedRoot((*it)->url, (*it)->service_provider.Pass()); | 94 root_node_manager_->EmbedRoot((*it)->url, (*it)->service_provider.Pass()); |
95 (*it)->callback.Run(true); | 95 (*it)->callback.Run(true); |
96 } | 96 } |
97 connect_params_.clear(); | 97 connect_params_.clear(); |
98 } | 98 } |
99 | 99 |
100 } // namespace service | 100 } // namespace service |
101 } // namespace mojo | 101 } // namespace mojo |
OLD | NEW |