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 "services/window_manager/window_manager_impl.h" | 5 #include "services/window_manager/window_manager_impl.h" |
6 | 6 |
7 #include "mojo/services/view_manager/public/cpp/view.h" | 7 #include "mojo/services/view_manager/public/cpp/view.h" |
8 #include "services/window_manager/focus_controller.h" | 8 #include "services/window_manager/focus_controller.h" |
9 #include "services/window_manager/window_manager_app.h" | 9 #include "services/window_manager/window_manager_app.h" |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 } | 42 } |
43 | 43 |
44 void WindowManagerImpl::NotifyCaptureChanged(Id new_capture_id, | 44 void WindowManagerImpl::NotifyCaptureChanged(Id new_capture_id, |
45 Id old_capture_id) { | 45 Id old_capture_id) { |
46 if (from_vm_) | 46 if (from_vm_) |
47 client()->OnCaptureChanged(old_capture_id, new_capture_id); | 47 client()->OnCaptureChanged(old_capture_id, new_capture_id); |
48 } | 48 } |
49 | 49 |
50 void WindowManagerImpl::Embed( | 50 void WindowManagerImpl::Embed( |
51 const mojo::String& url, | 51 const mojo::String& url, |
52 mojo::InterfaceRequest<mojo::ServiceProvider> service_provider) { | 52 mojo::InterfaceRequest<mojo::ServiceProvider> services, |
53 window_manager_->Embed(url, service_provider.Pass()); | 53 mojo::ServiceProviderPtr exposed_services) { |
| 54 window_manager_->Embed(url, services.Pass(), exposed_services.Pass()); |
54 } | 55 } |
55 | 56 |
56 void WindowManagerImpl::SetCapture(Id view, | 57 void WindowManagerImpl::SetCapture(Id view, |
57 const Callback<void(bool)>& callback) { | 58 const Callback<void(bool)>& callback) { |
58 if (!from_vm_) | 59 if (!from_vm_) |
59 return; // See comments for |from_vm_| on this. | 60 return; // See comments for |from_vm_| on this. |
60 | 61 |
61 bool success = window_manager_->IsReady(); | 62 bool success = window_manager_->IsReady(); |
62 if (success) | 63 if (success) |
63 window_manager_->SetCapture(view); | 64 window_manager_->SetCapture(view); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // TODO(sky): sanitize ids for client. | 101 // TODO(sky): sanitize ids for client. |
101 callback.Run(focused_view ? focused_view->id() : 0, | 102 callback.Run(focused_view ? focused_view->id() : 0, |
102 active_view ? active_view->id() : 0); | 103 active_view ? active_view->id() : 0); |
103 } | 104 } |
104 | 105 |
105 void WindowManagerImpl::OnConnectionError() { | 106 void WindowManagerImpl::OnConnectionError() { |
106 delete this; | 107 delete this; |
107 } | 108 } |
108 | 109 |
109 } // namespace window_manager | 110 } // namespace window_manager |
OLD | NEW |