chromium/chrome/browser/extensions/api/side_panel/side_panel_service.cc

// Copyright 2022 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/side_panel/side_panel_service.h"

#include <cstddef>
#include <memory>
#include <optional>

#include "base/no_destructor.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/extensions/extension_side_panel_utils.h"
#include "chrome/common/extensions/api/side_panel.h"
#include "chrome/common/extensions/api/side_panel/side_panel_info.h"
#include "components/sessions/core/session_id.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/pref_types.h"
#include "extensions/common/extension_features.h"

namespace extensions {

namespace {

// Key corresponding to whether the extension's side panel entry (if one exists)
// should be opened when its icon is clicked in the toolbar.
constexpr PrefMap kOpenSidePanelOnIconClickPref =;

api::side_panel::PanelOptions GetPanelOptionsFromManifest(
    const Extension& extension) {}

}  // namespace

SidePanelService::~SidePanelService() = default;

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

bool SidePanelService::HasSidePanelActionForTab(const Extension& extension,
                                                TabId tab_id) {}

bool SidePanelService::HasSidePanelContextMenuActionForTab(
    const Extension& extension,
    TabId tab_id) {}

bool SidePanelService::HasSidePanelAvailableForTab(const Extension& extension,
                                                   TabId tab_id) {}

api::side_panel::PanelOptions SidePanelService::GetOptions(
    const Extension& extension,
    std::optional<TabId> id) {}

api::side_panel::PanelOptions SidePanelService::GetSpecificOptionsForTab(
    const Extension& extension,
    TabId tab_id) {}

// Upsert to merge `panels_[extension_id][tab_id]` with `set_options`.
void SidePanelService::SetOptions(const Extension& extension,
                                  api::side_panel::PanelOptions options) {}

bool SidePanelService::HasExtensionPanelOptionsForTest(const ExtensionId& id) {}

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

// static
SidePanelService* SidePanelService::Get(content::BrowserContext* context) {}

void SidePanelService::RemoveExtensionOptions(const ExtensionId& id) {}

bool SidePanelService::OpenSidePanelOnIconClick(
    const ExtensionId& extension_id) {}

void SidePanelService::SetOpenSidePanelOnIconClick(
    const ExtensionId& extension_id,
    bool open_side_panel_on_icon_click) {}

base::expected<bool, std::string> SidePanelService::OpenSidePanelForWindow(
    const Extension& extension,
    content::BrowserContext* context,
    int window_id,
    bool include_incognito_information) {}

base::expected<bool, std::string> SidePanelService::OpenSidePanelForTab(
    const Extension& extension,
    content::BrowserContext* context,
    int tab_id,
    std::optional<int> window_id,
    bool include_incognito_information) {}

void SidePanelService::AddObserver(Observer* observer) {}

void SidePanelService::RemoveObserver(Observer* observer) {}

void SidePanelService::OnExtensionUnloaded(
    content::BrowserContext* browser_context,
    const Extension* extension,
    UnloadedExtensionReason reason) {}

void SidePanelService::OnExtensionUninstalled(
    content::BrowserContext* browser_context,
    const Extension* extension,
    UninstallReason reason) {}

void SidePanelService::Shutdown() {}

}  // namespace extensions