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/connection_manager.h" | 9 #include "mojo/services/view_manager/connection_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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 connection, | 51 connection, |
52 base::Bind(&ViewManagerInitServiceContext::OnNativeViewportDeleted, | 52 base::Bind(&ViewManagerInitServiceContext::OnNativeViewportDeleted, |
53 base::Unretained(this)))); | 53 base::Unretained(this)))); |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 void ViewManagerInitServiceContext::Embed( | 57 void ViewManagerInitServiceContext::Embed( |
58 const String& url, | 58 const String& url, |
59 ServiceProviderPtr service_provider, | 59 ServiceProviderPtr service_provider, |
60 const Callback<void(bool)>& callback) { | 60 const Callback<void(bool)>& callback) { |
61 connection_manager_->EmbedRoot(url, Get(&service_provider)); | 61 connection_manager_->EmbedRoot(url, GetProxy(&service_provider)); |
62 callback.Run(true); | 62 callback.Run(true); |
63 } | 63 } |
64 | 64 |
65 void ViewManagerInitServiceContext::OnNativeViewportDeleted() { | 65 void ViewManagerInitServiceContext::OnNativeViewportDeleted() { |
66 // Prevent the connection from modifying the connection list during manual | 66 // Prevent the connection from modifying the connection list during manual |
67 // teardown. | 67 // teardown. |
68 base::AutoReset<bool> deleting_connection(&deleting_connection_, true); | 68 base::AutoReset<bool> deleting_connection(&deleting_connection_, true); |
69 for (Connections::const_iterator it = connections_.begin(); | 69 for (Connections::const_iterator it = connections_.begin(); |
70 it != connections_.end(); ++it) { | 70 it != connections_.end(); ++it) { |
71 delete *it; | 71 delete *it; |
72 } | 72 } |
73 connections_.clear(); | 73 connections_.clear(); |
74 connection_manager_.reset(); | 74 connection_manager_.reset(); |
75 } | 75 } |
76 | 76 |
77 } // namespace service | 77 } // namespace service |
78 } // namespace mojo | 78 } // namespace mojo |
OLD | NEW |