| 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/public/cpp/lib/view_manager_client_impl.h" | 5 #include "mojo/services/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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 BindToRequest(exported_services, &parent_services); | 274 BindToRequest(exported_services, &parent_services); |
| 275 remote.reset(exported_services->CreateRemoteServiceProvider()); | 275 remote.reset(exported_services->CreateRemoteServiceProvider()); |
| 276 } | 276 } |
| 277 window_manager_.Bind(window_manager_pipe.Pass()); | 277 window_manager_.Bind(window_manager_pipe.Pass()); |
| 278 window_manager_.set_client(this); | 278 window_manager_.set_client(this); |
| 279 // base::Unretained() is safe here as |window_manager_| is bound to our | 279 // base::Unretained() is safe here as |window_manager_| is bound to our |
| 280 // lifetime. | 280 // lifetime. |
| 281 window_manager_->GetFocusedAndActiveViews( | 281 window_manager_->GetFocusedAndActiveViews( |
| 282 base::Bind(&ViewManagerClientImpl::OnGotFocusedAndActiveViews, | 282 base::Bind(&ViewManagerClientImpl::OnGotFocusedAndActiveViews, |
| 283 base::Unretained(this))); | 283 base::Unretained(this))); |
| 284 delegate_->OnEmbed(this, root_, exported_services, remote.Pass()); | 284 delegate_->OnEmbed(root_, exported_services, remote.Pass()); |
| 285 } | 285 } |
| 286 | 286 |
| 287 void ViewManagerClientImpl::OnEmbeddedAppDisconnected(Id view_id) { | 287 void ViewManagerClientImpl::OnEmbeddedAppDisconnected(Id view_id) { |
| 288 View* view = GetViewById(view_id); | 288 View* view = GetViewById(view_id); |
| 289 if (view) { | 289 if (view) { |
| 290 FOR_EACH_OBSERVER(ViewObserver, *ViewPrivate(view).observers(), | 290 FOR_EACH_OBSERVER(ViewObserver, *ViewPrivate(view).observers(), |
| 291 OnViewEmbeddedAppDisconnected(view)); | 291 OnViewEmbeddedAppDisconnected(view)); |
| 292 } | 292 } |
| 293 } | 293 } |
| 294 | 294 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 uint32 active_view_id) { | 471 uint32 active_view_id) { |
| 472 if (GetViewById(focused_view_id) != focused_view_) | 472 if (GetViewById(focused_view_id) != focused_view_) |
| 473 OnFocusChanged(focused_view_ ? focused_view_->id() : 0, focused_view_id); | 473 OnFocusChanged(focused_view_ ? focused_view_->id() : 0, focused_view_id); |
| 474 if (GetViewById(active_view_id) != activated_view_) { | 474 if (GetViewById(active_view_id) != activated_view_) { |
| 475 OnActiveWindowChanged(activated_view_ ? activated_view_->id() : 0, | 475 OnActiveWindowChanged(activated_view_ ? activated_view_->id() : 0, |
| 476 active_view_id); | 476 active_view_id); |
| 477 } | 477 } |
| 478 } | 478 } |
| 479 | 479 |
| 480 } // namespace mojo | 480 } // namespace mojo |
| OLD | NEW |