Chromium Code Reviews| 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 <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 Loading... | |
| 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 a frame is receiver frame and it navigates from blank to some url (e.g. | |
| 421 // https://www.google.com), we do not unregister the corresponding offscreen | |
| 422 // presentation. | |
| 423 if (receiver_delegate_) | |
|
mlamouri (slow - plz ping)
2017/04/10 12:50:28
How do we know the navigation came from blank here
zhaobin
2017/04/10 21:05:58
Code removed.
| |
| 424 return; | |
| 425 | |
| 420 // Reset if the frame actually navigated. | 426 // Reset if the frame actually navigated. |
| 421 Reset(); | 427 Reset(); |
| 422 } | 428 } |
| 423 | 429 |
| 424 void PresentationServiceImpl::RenderFrameDeleted( | 430 void PresentationServiceImpl::RenderFrameDeleted( |
| 425 content::RenderFrameHost* render_frame_host) { | 431 content::RenderFrameHost* render_frame_host) { |
| 426 DVLOG(2) << "PresentationServiceImpl::RenderFrameDeleted"; | 432 DVLOG(2) << "PresentationServiceImpl::RenderFrameDeleted"; |
| 427 if (!FrameMatches(render_frame_host)) | 433 if (!FrameMatches(render_frame_host)) |
| 428 return; | 434 return; |
| 429 | 435 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 510 | 516 |
| 511 void PresentationServiceImpl::NewPresentationCallbackWrapper::Run( | 517 void PresentationServiceImpl::NewPresentationCallbackWrapper::Run( |
| 512 const base::Optional<PresentationInfo>& presentation_info, | 518 const base::Optional<PresentationInfo>& presentation_info, |
| 513 const base::Optional<PresentationError>& error) { | 519 const base::Optional<PresentationError>& error) { |
| 514 DCHECK(!callback_.is_null()); | 520 DCHECK(!callback_.is_null()); |
| 515 callback_.Run(presentation_info, error); | 521 callback_.Run(presentation_info, error); |
| 516 callback_.Reset(); | 522 callback_.Reset(); |
| 517 } | 523 } |
| 518 | 524 |
| 519 } // namespace content | 525 } // namespace content |
| OLD | NEW |