// Copyright 2012 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // The DownloadManager object manages the process of downloading, including // updates to the history system and providing the information for displaying // the downloads view in the Destinations tab. There is one DownloadManager per // active browser context in Chrome. // // Download observers: // Objects that are interested in notifications about new downloads, or progress // updates for a given download must implement one of the download observer // interfaces: // DownloadManager::Observer: // - allows observers, primarily views, to be notified when changes to the // set of all downloads (such as new downloads, or deletes) occur // Use AddObserver() / RemoveObserver() on the appropriate download object to // receive state updates. // // Download state persistence: // The DownloadManager uses the history service for storing persistent // information about the state of all downloads. The history system maintains a // separate table for this called 'downloads'. At the point that the // DownloadManager is constructed, we query the history service for the state of // all persisted downloads. #ifndef CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ #include <stdint.h> #include <memory> #include <optional> #include <string> #include <vector> #include "base/files/file_path.h" #include "base/functional/callback.h" #include "base/task/sequenced_task_runner.h" #include "base/time/time.h" #include "components/download/public/common/download_interrupt_reasons.h" #include "components/download/public/common/download_item.h" #include "components/download/public/common/download_stream.mojom-forward.h" #include "components/download/public/common/download_url_parameters.h" #include "components/download/public/common/input_stream.h" #include "components/download/public/common/simple_download_manager.h" #include "content/common/content_export.h" #include "net/base/net_errors.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "url/origin.h" class GURL; namespace content { class BrowserContext; class DownloadManagerDelegate; class StoragePartitionConfig; // Browser's download manager: manages all downloads and destination view. class CONTENT_EXPORT DownloadManager : public base::SupportsUserData::Data, public download::SimpleDownloadManager { … }; } // namespace content #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_