#include "content/browser/attribution_reporting/attribution_manager.h"
#include "base/check.h"
#include "content/browser/attribution_reporting/attribution_os_level_manager.h"
#include "content/browser/storage_partition_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_client.h"
namespace content {
AttributionManager* AttributionManager::FromWebContents(
WebContents* web_contents) {
CHECK(web_contents);
return FromBrowserContext(web_contents->GetBrowserContext());
}
AttributionManager* AttributionManager::FromBrowserContext(
BrowserContext* browser_context) {
CHECK(browser_context);
return static_cast<StoragePartitionImpl*>(
browser_context->GetDefaultStoragePartition())
->GetAttributionManager();
}
network::mojom::AttributionSupport AttributionManager::GetAttributionSupport(
bool client_os_disabled) {
return GetContentClient()->browser()->GetAttributionSupport(
AttributionOsLevelManager::GetApiState(), client_os_disabled);
}
}