chromium/chrome/browser/extensions/api/reading_list/reading_list_event_router.cc

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

#include "chrome/browser/extensions/api/reading_list/reading_list_event_router.h"

#include "base/no_destructor.h"
#include "chrome/browser/extensions/api/reading_list/reading_list_util.h"
#include "chrome/browser/profiles/profile_keyed_service_factory.h"
#include "chrome/browser/reading_list/reading_list_model_factory.h"
#include "chrome/common/extensions/api/reading_list.h"
#include "components/reading_list/core/reading_list_entry.h"
#include "components/reading_list/core/reading_list_model.h"
#include "content/public/browser/browser_context.h"
#include "extensions/browser/event_router_factory.h"

namespace extensions {

namespace {

// The factory responsible for creating the per-profile event router for the
// ReadingList API.
class ReadingListEventRouterFactory : public ProfileKeyedServiceFactory {};

ReadingListEventRouterFactory::ReadingListEventRouterFactory()
    :{}

ReadingListEventRouter* ReadingListEventRouterFactory::GetForProfile(
    content::BrowserContext* context) {}

KeyedService* ReadingListEventRouterFactory::BuildServiceInstanceFor(
    content::BrowserContext* context) const {}

bool ReadingListEventRouterFactory::ServiceIsCreatedWithBrowserContext() const {}

// Since there is a dependency on `EventRouter` that is null by default in unit
// tests, this service needs to be null as well. If we want to enable it in a
// specific test we need to override the factories for both `EventRouter` and
// this factory to enforce the service creation.
bool ReadingListEventRouterFactory::ServiceIsNULLWhileTesting() const {}

}  // namespace

ReadingListEventRouter::ReadingListEventRouter(
    content::BrowserContext* browser_context)
    :{}

ReadingListEventRouter::~ReadingListEventRouter() = default;

// static
ReadingListEventRouter* ReadingListEventRouter::Get(
    content::BrowserContext* browser_context) {}

// static
ProfileKeyedServiceFactory* ReadingListEventRouter::GetFactoryInstance() {}

void ReadingListEventRouter::ReadingListDidAddEntry(
    const ReadingListModel* model,
    const GURL& url,
    reading_list::EntrySource source) {}

void ReadingListEventRouter::ReadingListWillRemoveEntry(
    const ReadingListModel* model,
    const GURL& url) {}

void ReadingListEventRouter::ReadingListDidUpdateEntry(
    const ReadingListModel* model,
    const GURL& url) {}

void ReadingListEventRouter::ReadingListDidMoveEntry(
    const ReadingListModel* model,
    const GURL& url) {}

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

}  // namespace extensions