chromium/chrome/browser/extensions/api/font_settings/font_settings_api.h

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

// Defines the classes to realize the Font Settings Extension API as specified
// in the extension API JSON.

#ifndef CHROME_BROWSER_EXTENSIONS_API_FONT_SETTINGS_FONT_SETTINGS_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_FONT_SETTINGS_FONT_SETTINGS_API_H_

#include <memory>
#include <string>

#include "base/memory/raw_ptr.h"
#include "base/values.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
#include "extensions/browser/extension_function.h"

namespace content {
class BrowserContext;
}

namespace extensions {

class FontSettingsEventRouter;

// The profile-keyed service that manages the font_settings extension API.
// This is not an EventRouter::Observer (and does not lazily initialize) because
// doing so caused a regression in perf tests. See crbug.com/163466.
class FontSettingsAPI : public BrowserContextKeyedAPI {};

// fontSettings.clearFont API function.
class FontSettingsClearFontFunction : public ExtensionFunction {};

// fontSettings.getFont API function.
class FontSettingsGetFontFunction : public ExtensionFunction {};

// fontSettings.setFont API function.
class FontSettingsSetFontFunction : public ExtensionFunction {};

// fontSettings.getFontList API function.
class FontSettingsGetFontListFunction : public ExtensionFunction {};

// Base class for extension API functions that clear a browser font pref.
class ClearFontPrefExtensionFunction : public ExtensionFunction {};

// Base class for extension API functions that get a browser font pref.
class GetFontPrefExtensionFunction : public ExtensionFunction {};

// Base class for extension API functions that set a browser font pref.
class SetFontPrefExtensionFunction : public ExtensionFunction {};

// The following are get/set/clear API functions that act on a browser font
// pref.

class FontSettingsClearDefaultFontSizeFunction
    : public ClearFontPrefExtensionFunction {};

class FontSettingsGetDefaultFontSizeFunction
    : public GetFontPrefExtensionFunction {};

class FontSettingsSetDefaultFontSizeFunction
    : public SetFontPrefExtensionFunction {};

class FontSettingsClearDefaultFixedFontSizeFunction
    : public ClearFontPrefExtensionFunction {};

class FontSettingsGetDefaultFixedFontSizeFunction
    : public GetFontPrefExtensionFunction {};

class FontSettingsSetDefaultFixedFontSizeFunction
    : public SetFontPrefExtensionFunction {};

class FontSettingsClearMinimumFontSizeFunction
    : public ClearFontPrefExtensionFunction {};

class FontSettingsGetMinimumFontSizeFunction
    : public GetFontPrefExtensionFunction {};

class FontSettingsSetMinimumFontSizeFunction
    : public SetFontPrefExtensionFunction {};

}  // namespace extensions

#endif  // CHROME_BROWSER_EXTENSIONS_API_FONT_SETTINGS_FONT_SETTINGS_API_H_