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

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

Issue 2801823003: [Presentation API] Change connection to 'connected' if start a presentation with "https://www.googl… (Closed)
Patch Set: fix content_unittest and layout test failures Created 3 years, 8 months 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 std::string curr_url_host = navigation_handle->GetURL().host(); 410 std::string curr_url_host = navigation_handle->GetURL().host();
411 411
412 // If a frame navigation is same-document (e.g. navigating to a fragment in 412 // If a frame navigation is same-document (e.g. navigating to a fragment in
413 // same page) then we do not unregister listeners. 413 // same page) then we do not unregister listeners.
414 DVLOG(2) << "DidNavigateAnyFrame: " 414 DVLOG(2) << "DidNavigateAnyFrame: "
415 << "prev host: " << prev_url_host << ", curr host: " << curr_url_host 415 << "prev host: " << prev_url_host << ", curr host: " << curr_url_host
416 << ", is_same_document: " << navigation_handle->IsSameDocument(); 416 << ", is_same_document: " << navigation_handle->IsSameDocument();
417 if (navigation_handle->IsSameDocument()) 417 if (navigation_handle->IsSameDocument())
418 return; 418 return;
419 419
420 if (receiver_delegate_)
imcheng 2017/04/08 00:05:59 Please add a comment here.
zhaobin 2017/04/08 01:36:01 Done.
421 return;
422
420 // Reset if the frame actually navigated. 423 // Reset if the frame actually navigated.
421 Reset(); 424 Reset();
422 } 425 }
423 426
424 void PresentationServiceImpl::RenderFrameDeleted( 427 void PresentationServiceImpl::RenderFrameDeleted(
425 content::RenderFrameHost* render_frame_host) { 428 content::RenderFrameHost* render_frame_host) {
426 DVLOG(2) << "PresentationServiceImpl::RenderFrameDeleted"; 429 DVLOG(2) << "PresentationServiceImpl::RenderFrameDeleted";
427 if (!FrameMatches(render_frame_host)) 430 if (!FrameMatches(render_frame_host))
428 return; 431 return;
429 432
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 513
511 void PresentationServiceImpl::NewPresentationCallbackWrapper::Run( 514 void PresentationServiceImpl::NewPresentationCallbackWrapper::Run(
512 const base::Optional<PresentationInfo>& presentation_info, 515 const base::Optional<PresentationInfo>& presentation_info,
513 const base::Optional<PresentationError>& error) { 516 const base::Optional<PresentationError>& error) {
514 DCHECK(!callback_.is_null()); 517 DCHECK(!callback_.is_null());
515 callback_.Run(presentation_info, error); 518 callback_.Run(presentation_info, error);
516 callback_.Reset(); 519 callback_.Reset();
517 } 520 }
518 521
519 } // namespace content 522 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698