blob: 759e5a3df2d9f6b0ad6663013b8ba585cbef8a23 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/common/content_export.h"
namespace download {
class DownloadItem;
namespace content {
class BrowserContext;
class WebContents;
// Helper class to attach WebContents and BrowserContext to a DownloadItem.
class CONTENT_EXPORT DownloadItemUtils {
// Helper method to get the BrowserContext from a DownloadItem.
static BrowserContext* GetBrowserContext(
const download::DownloadItem* downloadItem);
// Helper method to get the WebContents from a DownloadItem.
static WebContents* GetWebContents(
const download::DownloadItem* downloadItem);
// Attach information to a DownloadItem.
static void AttachInfo(download::DownloadItem* downloadItem,
BrowserContext* browser_context,
WebContents* web_contents);
} // namespace content