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/public/cpp/view_manager/lib/view_manager_client_impl.h" | 5 #include "mojo/services/public/cpp/view_manager/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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 // BindToRequest() binds the lifetime of |exported_services| to the pipe. | 268 // BindToRequest() binds the lifetime of |exported_services| to the pipe. |
269 exported_services = new ServiceProviderImpl; | 269 exported_services = new ServiceProviderImpl; |
270 BindToRequest(exported_services, &parent_services); | 270 BindToRequest(exported_services, &parent_services); |
271 remote.reset(exported_services->CreateRemoteServiceProvider()); | 271 remote.reset(exported_services->CreateRemoteServiceProvider()); |
272 } | 272 } |
273 window_manager_.Bind(window_manager_pipe.Pass()); | 273 window_manager_.Bind(window_manager_pipe.Pass()); |
274 window_manager_.set_client(this); | 274 window_manager_.set_client(this); |
275 delegate_->OnEmbed(this, root, exported_services, remote.Pass()); | 275 delegate_->OnEmbed(this, root, exported_services, remote.Pass()); |
276 } | 276 } |
277 | 277 |
| 278 void ViewManagerClientImpl::OnEmbeddedAppDisconnected(Id view_id) { |
| 279 View* view = GetViewById(view_id); |
| 280 if (view) { |
| 281 FOR_EACH_OBSERVER(ViewObserver, *ViewPrivate(view).observers(), |
| 282 OnViewEmbeddedAppDisconnected(view)); |
| 283 } |
| 284 } |
| 285 |
278 void ViewManagerClientImpl::OnViewBoundsChanged(Id view_id, | 286 void ViewManagerClientImpl::OnViewBoundsChanged(Id view_id, |
279 RectPtr old_bounds, | 287 RectPtr old_bounds, |
280 RectPtr new_bounds) { | 288 RectPtr new_bounds) { |
281 View* view = GetViewById(view_id); | 289 View* view = GetViewById(view_id); |
282 ViewPrivate(view).LocalSetBounds(*old_bounds, *new_bounds); | 290 ViewPrivate(view).LocalSetBounds(*old_bounds, *new_bounds); |
283 } | 291 } |
284 | 292 |
285 void ViewManagerClientImpl::OnViewHierarchyChanged( | 293 void ViewManagerClientImpl::OnViewHierarchyChanged( |
286 Id view_id, | 294 Id view_id, |
287 Id new_parent_id, | 295 Id new_parent_id, |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 base::Unretained(this)); | 418 base::Unretained(this)); |
411 } | 419 } |
412 | 420 |
413 base::Callback<void(ErrorCode)> | 421 base::Callback<void(ErrorCode)> |
414 ViewManagerClientImpl::ActionCompletedCallbackWithErrorCode() { | 422 ViewManagerClientImpl::ActionCompletedCallbackWithErrorCode() { |
415 return base::Bind(&ViewManagerClientImpl::OnActionCompletedWithErrorCode, | 423 return base::Bind(&ViewManagerClientImpl::OnActionCompletedWithErrorCode, |
416 base::Unretained(this)); | 424 base::Unretained(this)); |
417 } | 425 } |
418 | 426 |
419 } // namespace mojo | 427 } // namespace mojo |
OLD | NEW |