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 "view_manager/public/cpp/lib/view_manager_client_impl.h" | 5 #include "view_manager/public/cpp/lib/view_manager_client_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "mojo/public/cpp/application/application_impl.h" | 10 #include "mojo/public/cpp/application/application_impl.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 void ViewManagerClientImpl::Embed(const String& url, Id view_id) { | 198 void ViewManagerClientImpl::Embed(const String& url, Id view_id) { |
199 Embed(url, view_id, nullptr, nullptr); | 199 Embed(url, view_id, nullptr, nullptr); |
200 } | 200 } |
201 | 201 |
202 void ViewManagerClientImpl::Embed(const String& url, | 202 void ViewManagerClientImpl::Embed(const String& url, |
203 Id view_id, | 203 Id view_id, |
204 InterfaceRequest<ServiceProvider> services, | 204 InterfaceRequest<ServiceProvider> services, |
205 ServiceProviderPtr exposed_services) { | 205 ServiceProviderPtr exposed_services) { |
206 DCHECK(service_); | 206 DCHECK(service_); |
207 service_->Embed(url, view_id, services.Pass(), exposed_services.Pass(), | 207 service_->EmbedUrl(url, view_id, services.Pass(), exposed_services.Pass(), |
208 ActionCompletedCallback()); | 208 ActionCompletedCallback()); |
| 209 } |
| 210 |
| 211 void ViewManagerClientImpl::Embed(Id view_id, ViewManagerClientPtr client) { |
| 212 DCHECK(service_); |
| 213 service_->Embed(view_id, client.Pass(), ActionCompletedCallback()); |
209 } | 214 } |
210 | 215 |
211 void ViewManagerClientImpl::AddView(View* view) { | 216 void ViewManagerClientImpl::AddView(View* view) { |
212 DCHECK(views_.find(view->id()) == views_.end()); | 217 DCHECK(views_.find(view->id()) == views_.end()); |
213 views_[view->id()] = view; | 218 views_[view->id()] = view; |
214 } | 219 } |
215 | 220 |
216 void ViewManagerClientImpl::RemoveView(Id view_id) { | 221 void ViewManagerClientImpl::RemoveView(Id view_id) { |
217 IdToViewMap::iterator it = views_.find(view_id); | 222 IdToViewMap::iterator it = views_.find(view_id); |
218 if (it != views_.end()) | 223 if (it != views_.end()) |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 uint32_t active_view_id) { | 504 uint32_t active_view_id) { |
500 if (GetViewById(capture_view_id) != capture_view_) | 505 if (GetViewById(capture_view_id) != capture_view_) |
501 OnCaptureChanged(capture_view_id); | 506 OnCaptureChanged(capture_view_id); |
502 if (GetViewById(focused_view_id) != focused_view_) | 507 if (GetViewById(focused_view_id) != focused_view_) |
503 OnFocusChanged(focused_view_id); | 508 OnFocusChanged(focused_view_id); |
504 if (GetViewById(active_view_id) != activated_view_) | 509 if (GetViewById(active_view_id) != activated_view_) |
505 OnActiveWindowChanged(active_view_id); | 510 OnActiveWindowChanged(active_view_id); |
506 } | 511 } |
507 | 512 |
508 } // namespace mojo | 513 } // namespace mojo |
OLD | NEW |