chromium/extensions/browser/guest_view/mime_handler_view/mime_handler_view_embedder.h

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_EMBEDDER_H_
#define EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_EMBEDDER_H_

#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "extensions/common/api/mime_handler.mojom.h"
#include "extensions/common/mojom/guest_view.mojom.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "url/gurl.h"

namespace content {
class NavigationHandle;
class RenderFrameHost;
}  // namespace content

namespace guest_view {
class GuestViewBase;
}  // namespace guest_view

namespace extensions {

// MimeHandlerViewEmbedder is instantiated in response to a frame navigation to
// a resource with a MIME type handled by MimeHandlerViewGuest. MHVE tracks the
// navigation to the template HTML document injected by the
// MimeHandlerViewAttachHelper and when the <embed>'s RenderFrameHost is ready,
// proceeds with creating a BeforeUnloadControl on the renderer side. After the
// renderer confirms the creation of BUC the MHVE will create and attach a
// MHVG. At this point MHVE is no longer needed and it clears itself.
// Note: the MHVE might go away sooner if:
//   - A new navigation starts in the embedder frame,
//   - the navigation to the resource fails, or,
//.  - the embedder or the injected <embed> are removed from DOM.
class MimeHandlerViewEmbedder : public content::WebContentsObserver {};

}  // namespace extensions
#endif  // EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_EMBEDDER_H_