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

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: Created 5 years, 1 month 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 400
401 void PresentationServiceImpl::CloseSession( 401 void PresentationServiceImpl::CloseSession(
402 const mojo::String& presentation_url, 402 const mojo::String& presentation_url,
403 const mojo::String& presentation_id) { 403 const mojo::String& presentation_id) {
404 DVLOG(2) << "CloseSession " << presentation_id; 404 DVLOG(2) << "CloseSession " << presentation_id;
405 if (delegate_) 405 if (delegate_)
406 delegate_->CloseSession(render_process_id_, render_frame_id_, 406 delegate_->CloseSession(render_process_id_, render_frame_id_,
407 presentation_id); 407 presentation_id);
408 } 408 }
409 409
410 void PresentationServiceImpl::TerminateSession(
411 const mojo::String& presentation_url,
412 const mojo::String& presentation_id) {
413 DVLOG(2) << "TerminateSession " << presentation_id;
414 if (delegate_)
415 delegate_->TerminateSession(render_process_id_, render_frame_id_,
416 presentation_id);
417 }
418
410 void PresentationServiceImpl::ListenForSessionStateChange() { 419 void PresentationServiceImpl::ListenForSessionStateChange() {
411 if (!delegate_) 420 if (!delegate_)
412 return; 421 return;
413 422
414 delegate_->ListenForSessionStateChange( 423 delegate_->ListenForSessionStateChange(
415 render_process_id_, render_frame_id_, 424 render_process_id_, render_frame_id_,
416 base::Bind(&PresentationServiceImpl::OnSessionStateChanged, 425 base::Bind(&PresentationServiceImpl::OnSessionStateChanged,
417 weak_factory_.GetWeakPtr())); 426 weak_factory_.GetWeakPtr()));
418 } 427 }
419 428
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 591
583 void PresentationServiceImpl::NewSessionMojoCallbackWrapper::Run( 592 void PresentationServiceImpl::NewSessionMojoCallbackWrapper::Run(
584 presentation::PresentationSessionInfoPtr session, 593 presentation::PresentationSessionInfoPtr session,
585 presentation::PresentationErrorPtr error) { 594 presentation::PresentationErrorPtr error) {
586 DCHECK(!callback_.is_null()); 595 DCHECK(!callback_.is_null());
587 callback_.Run(session.Pass(), error.Pass()); 596 callback_.Run(session.Pass(), error.Pass());
588 callback_.reset(); 597 callback_.reset();
589 } 598 }
590 599
591 } // namespace content 600 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698