#include "chrome/browser/download/download_crx_util.h"
#include <memory>
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "chrome/browser/extensions/extension_management.h"
#include "chrome/browser/extensions/webstore_installer.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "components/download/public/common/download_item.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_item_utils.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/user_script.h"
BrowserThread;
DownloadItem;
WebstoreInstaller;
namespace download_crx_util {
namespace {
bool g_allow_offstore_install_for_testing = …;
ExtensionInstallPrompt* mock_install_prompt_for_testing = …;
std::unique_ptr<ExtensionInstallPrompt> CreateExtensionInstallPrompt(
Profile* profile,
const DownloadItem& download_item) { … }
}
bool OffStoreInstallAllowedByPrefs(Profile* profile, const DownloadItem& item) { … }
void SetMockInstallPromptForTesting(
std::unique_ptr<ExtensionInstallPrompt> mock_prompt) { … }
scoped_refptr<extensions::CrxInstaller> CreateCrxInstaller(
Profile* profile,
const download::DownloadItem& download_item) { … }
bool IsExtensionDownload(const DownloadItem& download_item) { … }
bool IsTrustedExtensionDownload(Profile* profile, const DownloadItem& item) { … }
std::unique_ptr<base::AutoReset<bool>> OverrideOffstoreInstallAllowedForTesting(
bool allowed) { … }
}