| Index: components/guest_view/browser/guest_view_base.cc
|
| diff --git a/components/guest_view/browser/guest_view_base.cc b/components/guest_view/browser/guest_view_base.cc
|
| index 98a25805dc97d27858a0ebb3f605932eb938f0e4..f221fd6aff16f2aead8b25f2ba9ddd5673f4760c 100644
|
| --- a/components/guest_view/browser/guest_view_base.cc
|
| +++ b/components/guest_view/browser/guest_view_base.cc
|
| @@ -16,7 +16,7 @@
|
| #include "components/guest_view/common/guest_view_messages.h"
|
| #include "components/zoom/page_zoom.h"
|
| #include "components/zoom/zoom_controller.h"
|
| -#include "content/public/browser/navigation_details.h"
|
| +#include "content/public/browser/navigation_handle.h"
|
| #include "content/public/browser/render_frame_host.h"
|
| #include "content/public/browser/render_process_host.h"
|
| #include "content/public/browser/render_view_host.h"
|
| @@ -70,12 +70,16 @@ class GuestViewBase::OwnerContentsObserver : public WebContentsObserver {
|
| Destroy();
|
| }
|
|
|
| - void DidNavigateMainFrame(
|
| - const content::LoadCommittedDetails& details,
|
| - const content::FrameNavigateParams& params) override {
|
| + void DidFinishNavigation(
|
| + content::NavigationHandle* navigation_handle) override {
|
| // If the embedder navigates to a different page then destroy the guest.
|
| - if (details.is_navigation_to_different_page())
|
| - Destroy();
|
| + if (!navigation_handle->IsInMainFrame() ||
|
| + !navigation_handle->HasCommitted() ||
|
| + navigation_handle->IsSamePage()) {
|
| + return;
|
| + }
|
| +
|
| + Destroy();
|
| }
|
|
|
| void RenderProcessGone(base::TerminationStatus status) override {
|
| @@ -221,9 +225,9 @@ void GuestViewBase::InitWithWebContents(
|
| // after the latter has handled WebContentsObserver events (observers are
|
| // notified of events in the same order they are added as observers). For
|
| // example, GuestViewBase may wish to put its guest into isolated zoom mode
|
| - // in DidNavigateMainFrame, but since ZoomController always resets to default
|
| + // in DidFinishNavigation, but since ZoomController always resets to default
|
| // zoom mode on this event, GuestViewBase would need to do so after
|
| - // ZoomController::DidNavigateMainFrame has completed.
|
| + // ZoomController::DidFinishNavigation has completed.
|
| zoom::ZoomController::CreateForWebContents(guest_web_contents);
|
|
|
| // At this point, we have just created the guest WebContents, we need to add
|
| @@ -605,9 +609,11 @@ void GuestViewBase::WebContentsDestroyed() {
|
| delete this;
|
| }
|
|
|
| -void GuestViewBase::DidNavigateMainFrame(
|
| - const content::LoadCommittedDetails& details,
|
| - const content::FrameNavigateParams& params) {
|
| +void GuestViewBase::DidFinishNavigation(
|
| + content::NavigationHandle* navigation_handle) {
|
| + if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted())
|
| + return;
|
| +
|
| if (attached() && ZoomPropagatesFromEmbedderToGuest())
|
| SetGuestZoomLevelToMatchEmbedder();
|
| }
|
|
|