Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: content/browser/presentation/presentation_service_impl.cc

Issue 1466573002: Presentation API: implement renderer side of PresentationConnection.close(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 415
416 void PresentationServiceImpl::CloseSession( 416 void PresentationServiceImpl::CloseSession(
417 const mojo::String& presentation_url, 417 const mojo::String& presentation_url,
418 const mojo::String& presentation_id) { 418 const mojo::String& presentation_id) {
419 DVLOG(2) << "CloseSession " << presentation_id; 419 DVLOG(2) << "CloseSession " << presentation_id;
420 if (delegate_) 420 if (delegate_)
421 delegate_->CloseSession(render_process_id_, render_frame_id_, 421 delegate_->CloseSession(render_process_id_, render_frame_id_,
422 presentation_id); 422 presentation_id);
423 } 423 }
424 424
425 void PresentationServiceImpl::TerminateSession(
426 const mojo::String& presentation_url,
427 const mojo::String& presentation_id) {
428 DVLOG(2) << "TerminateSession " << presentation_id;
429 if (delegate_)
430 delegate_->TerminateSession(render_process_id_, render_frame_id_,
431 presentation_id);
432 }
433
425 void PresentationServiceImpl::OnConnectionStateChanged( 434 void PresentationServiceImpl::OnConnectionStateChanged(
426 const PresentationSessionInfo& connection, 435 const PresentationSessionInfo& connection,
427 PresentationConnectionState state) { 436 PresentationConnectionState state) {
428 DCHECK(client_.get()); 437 DCHECK(client_.get());
429 client_->OnConnectionStateChanged( 438 client_->OnConnectionStateChanged(
430 presentation::PresentationSessionInfo::From(connection), 439 presentation::PresentationSessionInfo::From(connection),
431 PresentationConnectionStateToMojo(state)); 440 PresentationConnectionStateToMojo(state));
432 } 441 }
433 442
434 bool PresentationServiceImpl::FrameMatches( 443 bool PresentationServiceImpl::FrameMatches(
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 597
589 void PresentationServiceImpl::NewSessionMojoCallbackWrapper::Run( 598 void PresentationServiceImpl::NewSessionMojoCallbackWrapper::Run(
590 presentation::PresentationSessionInfoPtr session, 599 presentation::PresentationSessionInfoPtr session,
591 presentation::PresentationErrorPtr error) { 600 presentation::PresentationErrorPtr error) {
592 DCHECK(!callback_.is_null()); 601 DCHECK(!callback_.is_null());
593 callback_.Run(session.Pass(), error.Pass()); 602 callback_.Run(session.Pass(), error.Pass());
594 callback_.reset(); 603 callback_.reset();
595 } 604 }
596 605
597 } // namespace content 606 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698