OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/browser/presentation/presentation_service_impl.h" | 5 #include "content/browser/presentation/presentation_service_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 web_contents, | 162 web_contents, |
163 GetContentClient()->browser()->GetPresentationServiceDelegate( | 163 GetContentClient()->browser()->GetPresentationServiceDelegate( |
164 web_contents)); | 164 web_contents)); |
165 impl->Bind(request.Pass()); | 165 impl->Bind(request.Pass()); |
166 } | 166 } |
167 | 167 |
168 void PresentationServiceImpl::Bind( | 168 void PresentationServiceImpl::Bind( |
169 mojo::InterfaceRequest<presentation::PresentationService> request) { | 169 mojo::InterfaceRequest<presentation::PresentationService> request) { |
170 binding_.reset(new mojo::Binding<presentation::PresentationService>( | 170 binding_.reset(new mojo::Binding<presentation::PresentationService>( |
171 this, request.Pass())); | 171 this, request.Pass())); |
172 binding_->set_connection_error_handler([this]() { | 172 binding_->set_error_handler(this); |
173 DVLOG(1) << "Connection error"; | 173 } |
174 delete this; | 174 |
175 }); | 175 void PresentationServiceImpl::OnConnectionError() { |
| 176 DVLOG(1) << "OnConnectionError"; |
| 177 delete this; |
176 } | 178 } |
177 | 179 |
178 void PresentationServiceImpl::SetClient( | 180 void PresentationServiceImpl::SetClient( |
179 presentation::PresentationServiceClientPtr client) { | 181 presentation::PresentationServiceClientPtr client) { |
180 DCHECK(!client_.get()); | 182 DCHECK(!client_.get()); |
181 // TODO(imcheng): Set ErrorHandler to listen for errors. | 183 // TODO(imcheng): Set ErrorHandler to listen for errors. |
182 client_ = client.Pass(); | 184 client_ = client.Pass(); |
183 } | 185 } |
184 | 186 |
185 void PresentationServiceImpl::ListenForScreenAvailability( | 187 void PresentationServiceImpl::ListenForScreenAvailability( |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 | 629 |
628 void PresentationServiceImpl::DefaultSessionStartContext::Reset() { | 630 void PresentationServiceImpl::DefaultSessionStartContext::Reset() { |
629 ScopedVector<DefaultSessionMojoCallback> callbacks; | 631 ScopedVector<DefaultSessionMojoCallback> callbacks; |
630 callbacks.swap(callbacks_); | 632 callbacks.swap(callbacks_); |
631 for (const auto& callback : callbacks) | 633 for (const auto& callback : callbacks) |
632 callback->Run(presentation::PresentationSessionInfoPtr()); | 634 callback->Run(presentation::PresentationSessionInfoPtr()); |
633 session_.reset(); | 635 session_.reset(); |
634 } | 636 } |
635 | 637 |
636 } // namespace content | 638 } // namespace content |
OLD | NEW |