    // chrome::mojom::ProfileImport:
    void StartImport(const importer::SourceProfile& source_profile,
                     uint16_t items,
+diff --git a/components/guest_view/browser/guest_view_base.cc b/components/guest_view/browser/guest_view_base.cc
+index 24ec4b67e72b1490f6572f4367e6233e57c0a373..01b6de185a40771b27ec4647f74e343cb378f930 100644
+--- a/components/guest_view/browser/guest_view_base.cc
++++ b/components/guest_view/browser/guest_view_base.cc
+@@ -439,8 +439,12 @@ void GuestViewBase::DidDetach() {
+   owner_web_contents()->Send(new GuestViewMsg_GuestDetached(
+       element_instance_id_));
+   element_instance_id_ = kInstanceIDNone;
+-  if (ShouldDestroyOnDetach())
++  if (ShouldDestroyOnDetach()) {
+     Destroy(true);
++  } else {
++    // Give the derived class an opportunity to perform some actions.
++    DidDetachFromEmbedder();
++ }
+ }
+ 
+ WebContents* GuestViewBase::GetOwnerWebContents() const {
 diff --git a/components/guest_view/browser/guest_view_base.h b/components/guest_view/browser/guest_view_base.h
-index 70fa25235c54f395cb3026f278b6d2c641901107..f344ddafb147a69aa82e252ed4de87c685c260c9 100644
+index 8b7d21dfa7d35ed5090f5883e7fe78f8b6c1485b..e63d654afe83802fbd95c2f9a6ea3eb9ca9f0990 100644
 --- a/components/guest_view/browser/guest_view_base.h
 +++ b/components/guest_view/browser/guest_view_base.h
-@@ -242,6 +242,9 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate,
+@@ -247,6 +247,9 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate,
    // an opportunity to perform setup actions after attachment.
    virtual void DidAttachToEmbedder() {}
  

 
 bool PrintWebViewHelper::PreviewPageRendered(int page_number,
                                              PdfMetafileSkia* metafile) {
@@ -2100,6 +2126,7 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number,
     return false;
   }
 

 
 #if BUILDFLAG(ENABLE_BASIC_PRINTING)
 void PrintWebViewHelper::GetPrintSettingsFromUser(
@@ -2079,6 +2101,7 @@ bool PrintWebViewHelper::CheckForCancel() {
     notify_browser_of_print_failure_ = false;
   return cancel;
 }
