| 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 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "content/browser/presentation/presentation_type_converters.h" | 10 #include "content/browser/presentation/presentation_type_converters.h" |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 const content::FrameNavigateParams& params) { | 483 const content::FrameNavigateParams& params) { |
| 484 DVLOG(2) << "PresentationServiceImpl::DidNavigateAnyFrame"; | 484 DVLOG(2) << "PresentationServiceImpl::DidNavigateAnyFrame"; |
| 485 if (!FrameMatches(render_frame_host)) | 485 if (!FrameMatches(render_frame_host)) |
| 486 return; | 486 return; |
| 487 | 487 |
| 488 std::string prev_url_host = details.previous_url.host(); | 488 std::string prev_url_host = details.previous_url.host(); |
| 489 std::string curr_url_host = params.url.host(); | 489 std::string curr_url_host = params.url.host(); |
| 490 | 490 |
| 491 // If a frame navigation is in-page (e.g. navigating to a fragment in | 491 // If a frame navigation is in-page (e.g. navigating to a fragment in |
| 492 // same page) then we do not unregister listeners. | 492 // same page) then we do not unregister listeners. |
| 493 bool in_page_navigation = details.is_in_page || | |
| 494 details.type == content::NAVIGATION_TYPE_IN_PAGE; | |
| 495 | |
| 496 DVLOG(2) << "DidNavigateAnyFrame: " | 493 DVLOG(2) << "DidNavigateAnyFrame: " |
| 497 << "prev host: " << prev_url_host << ", curr host: " << curr_url_host | 494 << "prev host: " << prev_url_host << ", curr host: " << curr_url_host |
| 498 << ", in_page_navigation: " << in_page_navigation; | 495 << ", details.is_in_page: " << details.is_in_page; |
| 499 | 496 if (details.is_in_page) |
| 500 if (in_page_navigation) | |
| 501 return; | 497 return; |
| 502 | 498 |
| 503 // Reset if the frame actually navigated. | 499 // Reset if the frame actually navigated. |
| 504 Reset(); | 500 Reset(); |
| 505 } | 501 } |
| 506 | 502 |
| 507 void PresentationServiceImpl::RenderFrameDeleted( | 503 void PresentationServiceImpl::RenderFrameDeleted( |
| 508 content::RenderFrameHost* render_frame_host) { | 504 content::RenderFrameHost* render_frame_host) { |
| 509 DVLOG(2) << "PresentationServiceImpl::RenderFrameDeleted"; | 505 DVLOG(2) << "PresentationServiceImpl::RenderFrameDeleted"; |
| 510 if (!FrameMatches(render_frame_host)) | 506 if (!FrameMatches(render_frame_host)) |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 void PresentationServiceImpl::DefaultSessionStartContext::Reset() { | 634 void PresentationServiceImpl::DefaultSessionStartContext::Reset() { |
| 639 ScopedVector<DefaultSessionMojoCallback> callbacks; | 635 ScopedVector<DefaultSessionMojoCallback> callbacks; |
| 640 callbacks.swap(callbacks_); | 636 callbacks.swap(callbacks_); |
| 641 for (const auto& callback : callbacks) | 637 for (const auto& callback : callbacks) |
| 642 callback->Run(presentation::PresentationSessionInfoPtr()); | 638 callback->Run(presentation::PresentationSessionInfoPtr()); |
| 643 session_.reset(); | 639 session_.reset(); |
| 644 } | 640 } |
| 645 | 641 |
| 646 } // namespace content | 642 } // namespace content |
| 647 | 643 |
| OLD | NEW |