chromium/extensions/browser/api/system_info/system_info_api.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "extensions/browser/api/system_info/system_info_api.h"

#include <stdint.h>

#include <memory>
#include <utility>

#include "base/containers/flat_set.h"
#include "base/functional/bind.h"
#include "base/lazy_instance.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/singleton.h"
#include "base/values.h"
#include "components/storage_monitor/removable_storage_observer.h"
#include "components/storage_monitor/storage_info.h"
#include "components/storage_monitor/storage_monitor.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/api/system_display/display_info_provider.h"
#include "extensions/browser/api/system_info/system_info_provider.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/common/api/system_display.h"
#include "extensions/common/api/system_storage.h"

namespace extensions {

StorageUnitInfo;
BrowserThread;
StorageMonitor;

system_display;
system_storage;

namespace {

/******************************************************************************/
// Begin SystemInfoEventRouter
/******************************************************************************/

// Event router for systemInfo API. This class is responsible for managing
// display-changed and removable-storage event dispatch. The storage event
// dispatch is handled by this class, whereas display-changed event dispatch is
// delegated to the DisplayInfoProvider. This class is a singleton instance
// shared across multiple browser contexts.
class SystemInfoEventRouter : public storage_monitor::RemovableStorageObserver {};

static base::LazyInstance<SystemInfoEventRouter>::Leaky
    g_system_info_event_router =;

// static
SystemInfoEventRouter* SystemInfoEventRouter::GetInstance() {}

SystemInfoEventRouter::SystemInfoEventRouter() = default;

SystemInfoEventRouter::~SystemInfoEventRouter() {}

void SystemInfoEventRouter::CheckForDisplayListeners(
    content::BrowserContext* context) {}

void SystemInfoEventRouter::CheckForStorageListeners(
    content::BrowserContext* context) {}

void SystemInfoEventRouter::ShutdownForContext(
    content::BrowserContext* context) {}

void SystemInfoEventRouter::StartOrStopDisplayEventDispatcherIfNecessary() {}

void SystemInfoEventRouter::StartOrStopStorageEventDispatcherIfNecessary() {}

void SystemInfoEventRouter::OnRemovableStorageAttached(
    const storage_monitor::StorageInfo& info) {}

void SystemInfoEventRouter::OnRemovableStorageDetached(
    const storage_monitor::StorageInfo& info) {}

void SystemInfoEventRouter::DispatchEvent(
    events::HistogramValue histogram_value,
    const std::string& event_name,
    base::Value::List args) const {}

/******************************************************************************/
// End SystemInfoEventRouter
/******************************************************************************/

void HandleListenerAddedOrRemoved(content::BrowserContext* context,
                                  const std::string& event_name) {}

}  // namespace

static base::LazyInstance<
    BrowserContextKeyedAPIFactory<SystemInfoAPI>>::DestructorAtExit g_factory =;

// static
BrowserContextKeyedAPIFactory<SystemInfoAPI>*
SystemInfoAPI::GetFactoryInstance() {}

SystemInfoAPI::SystemInfoAPI(content::BrowserContext* context)
    :{}

SystemInfoAPI::~SystemInfoAPI() = default;

void SystemInfoAPI::Shutdown() {}

void SystemInfoAPI::OnListenerAdded(const EventListenerInfo& details) {}

void SystemInfoAPI::OnListenerRemoved(const EventListenerInfo& details) {}

}  // namespace extensions