#ifndef COMPONENTS_DOWNLOAD_CONTENT_PUBLIC_DOWNLOAD_NAVIGATION_OBSERVER_H_
#define COMPONENTS_DOWNLOAD_CONTENT_PUBLIC_DOWNLOAD_NAVIGATION_OBSERVER_H_
#include "base/memory/raw_ptr.h"
#include "components/download/public/background_service/navigation_monitor.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
namespace download {
class DownloadNavigationObserver
: public content::WebContentsObserver,
public content::WebContentsUserData<DownloadNavigationObserver> {
public:
DownloadNavigationObserver(content::WebContents* web_contents,
NavigationMonitor* navigation_monitor);
DownloadNavigationObserver(const DownloadNavigationObserver&) = delete;
DownloadNavigationObserver& operator=(const DownloadNavigationObserver&) =
delete;
~DownloadNavigationObserver() override;
private:
friend class content::WebContentsUserData<DownloadNavigationObserver>;
void DidStartLoading() override;
void DidStopLoading() override;
void NotifyNavigationEvent(NavigationEvent navigation_event);
raw_ptr<NavigationMonitor> navigation_monitor_;
WEB_CONTENTS_USER_DATA_KEY_DECL();
};
}
#endif