#include "content/public/browser/download_item_utils.h"
#include "base/memory/raw_ptr.h"
#include "components/download/public/common/download_item.h"
#include "content/public/browser/global_routing_id.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
namespace content {
namespace {
class DownloadItemData : public base::SupportsUserData::Data,
public WebContentsObserver { … };
const char DownloadItemData::kKey[] = …;
DownloadItemData::DownloadItemData(BrowserContext* browser_context,
WebContents* web_contents,
GlobalRenderFrameHostId id)
: … { … }
void DownloadItemData::Attach(download::DownloadItem* download_item,
BrowserContext* browser_context,
WebContents* web_contents,
GlobalRenderFrameHostId id) { … }
DownloadItemData* DownloadItemData::Get(
const download::DownloadItem* download_item) { … }
void DownloadItemData::Detach(download::DownloadItem* download_item) { … }
void DownloadItemData::PrimaryPageChanged(Page& page) { … }
void DownloadItemData::WebContentsDestroyed() { … }
}
BrowserContext* DownloadItemUtils::GetBrowserContext(
const download::DownloadItem* download_item) { … }
WebContents* DownloadItemUtils::GetWebContents(
const download::DownloadItem* download_item) { … }
RenderFrameHost* DownloadItemUtils::GetRenderFrameHost(
const download::DownloadItem* download_item) { … }
WebContents* DownloadItemUtils::GetOriginalWebContents(
const download::DownloadItem* download_item) { … }
void DownloadItemUtils::AttachInfo(download::DownloadItem* download_item,
BrowserContext* browser_context,
WebContents* web_contents,
GlobalRenderFrameHostId id) { … }
void DownloadItemUtils::AttachInfoForTesting(
download::DownloadItem* download_item,
BrowserContext* browser_context,
WebContents* web_contents) { … }
}