#include "chrome/browser/resource_coordinator/discard_before_unload_helper.h"
#include "base/functional/bind.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
namespace resource_coordinator {
namespace {
class DiscardBeforeUnloadHelper : public content::WebContentsObserver { … };
void DiscardBeforeUnloadHelper::HasBeforeUnloadHandler(
content::WebContents* contents,
HasBeforeUnloadHandlerCallback&& callback) { … }
DiscardBeforeUnloadHelper::DiscardBeforeUnloadHelper(
content::WebContents* contents,
HasBeforeUnloadHandlerCallback&& callback)
: … { … }
DiscardBeforeUnloadHelper::~DiscardBeforeUnloadHelper() = default;
void DiscardBeforeUnloadHelper::BeforeUnloadFired(bool proceed) { … }
void DiscardBeforeUnloadHelper::BeforeUnloadDialogCancelled() { … }
void DiscardBeforeUnloadHelper::WebContentsDestroyed() { … }
void DiscardBeforeUnloadHelper::Respond(bool has_beforeunload_handler) { … }
}
void HasBeforeUnloadHandler(content::WebContents* contents,
HasBeforeUnloadHandlerCallback&& callback) { … }
}