#include "chrome/browser/enterprise/connectors/reporting/extension_install_event_router.h"
#include <optional>
#include "base/feature_list.h"
#include "base/memory/singleton.h"
#include "chrome/browser/enterprise/connectors/common.h"
#include "chrome/browser/enterprise/connectors/reporting/realtime_reporting_client_factory.h"
#include "chrome/browser/extensions/chrome_content_browser_client_extensions_part.h"
#include "components/enterprise/connectors/core/reporting_service_settings.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_registry_factory.h"
namespace enterprise_connectors {
namespace {
constexpr char kKeyId[] = …;
constexpr char kKeyName[] = …;
constexpr char kKeyDescription[] = …;
constexpr char kKeyAction[] = …;
constexpr char kKeyVersion[] = …;
constexpr char kKeySource[] = …;
constexpr char kInstallAction[] = …;
constexpr char kUpdateAction[] = …;
constexpr char kUninstallAction[] = …;
constexpr char kChromeWebstoreSource[] = …;
constexpr char kExternalSource[] = …;
}
ExtensionInstallEventRouter::ExtensionInstallEventRouter(
content::BrowserContext* context) { … }
ExtensionInstallEventRouter::~ExtensionInstallEventRouter() { … }
void ExtensionInstallEventRouter::ReportExtensionInstallEvent(
const extensions::Extension* extension,
const char* extension_action) { … }
void ExtensionInstallEventRouter::OnExtensionInstalled(
content::BrowserContext* browser_context,
const extensions::Extension* extension,
bool is_update) { … }
void ExtensionInstallEventRouter::OnExtensionUninstalled(
content::BrowserContext* browser_context,
const extensions::Extension* extension,
extensions::UninstallReason reason) { … }
ExtensionInstallEventRouterFactory*
ExtensionInstallEventRouterFactory::GetInstance() { … }
ExtensionInstallEventRouter*
ExtensionInstallEventRouterFactory::GetForBrowserContext(
content::BrowserContext* context) { … }
ExtensionInstallEventRouterFactory::ExtensionInstallEventRouterFactory()
: … { … }
ExtensionInstallEventRouterFactory::~ExtensionInstallEventRouterFactory() =
default;
bool ExtensionInstallEventRouterFactory::ServiceIsCreatedWithBrowserContext()
const { … }
KeyedService* ExtensionInstallEventRouterFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const { … }
content::BrowserContext*
ExtensionInstallEventRouterFactory::GetBrowserContextToUse(
content::BrowserContext* context) const { … }
}