Chromium Code Reviews| Index: mojo/services/view_manager/window_tree_host_impl.cc |
| diff --git a/mojo/services/view_manager/window_tree_host_impl.cc b/mojo/services/view_manager/window_tree_host_impl.cc |
| index 5ef5da4af19576bdc6fdf8a7b56e7576f3141de8..f7c15535e0dce4777db2e3f16146e46097a2965a 100644 |
| --- a/mojo/services/view_manager/window_tree_host_impl.cc |
| +++ b/mojo/services/view_manager/window_tree_host_impl.cc |
| @@ -68,9 +68,11 @@ void RootLayoutManager::SetChildBounds(aura::Window* child, |
| WindowTreeHostImpl::WindowTreeHostImpl( |
| NativeViewportPtr viewport, |
| const gfx::Rect& bounds, |
| - const base::Callback<void()>& compositor_created_callback) |
| + const Callback<void()>& compositor_created_callback, |
| + const Callback<void()>& native_viewport_closed_callback) |
| : native_viewport_(viewport.Pass()), |
| compositor_created_callback_(compositor_created_callback), |
| + native_viewport_closed_callback_(native_viewport_closed_callback), |
| bounds_(bounds) { |
| native_viewport_.set_client(this); |
| native_viewport_->Create(Rect::From(bounds)); |
| @@ -178,8 +180,11 @@ void WindowTreeHostImpl::OnBoundsChanged(RectPtr bounds) { |
| OnHostResized(bounds_.size()); |
| } |
| -void WindowTreeHostImpl::OnDestroyed() { |
| - base::MessageLoop::current()->Quit(); |
| +void WindowTreeHostImpl::OnDestroyed(const mojo::Callback<void()>& callback) { |
| + DestroyCompositor(); |
| + native_viewport_closed_callback_.Run(); |
| + //base::MessageLoop::current()->Quit(); |
|
sky
2014/07/10 22:54:29
remove commented out code.
|
| + callback.Run(); |
| } |
| void WindowTreeHostImpl::OnEvent(EventPtr event, |