#include "chrome/browser/extensions/extension_action_storage_manager.h"
#include <stdint.h>
#include <memory>
#include <utility>
#include "base/base64.h"
#include "base/functional/bind.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "extensions/browser/extension_action_manager.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/state_store.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension_id.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_rep.h"
namespace extensions {
namespace {
const char kBrowserActionStorageKey[] = …;
const char kPopupUrlStorageKey[] = …;
const char kTitleStorageKey[] = …;
const char kIconStorageKey[] = …;
const char kBadgeTextStorageKey[] = …;
const char kBadgeBackgroundColorStorageKey[] = …;
const char kBadgeTextColorStorageKey[] = …;
const char kAppearanceStorageKey[] = …;
enum StoredAppearance { … };
SkColor RawStringToSkColor(const std::string& str) { … }
std::string SkColorToRawString(SkColor color) { … }
bool StringToSkBitmap(const std::string& str, SkBitmap* bitmap) { … }
std::string BitmapToString(const SkBitmap& bitmap) { … }
void SetDefaultsFromValue(const base::Value::Dict& dict,
ExtensionAction* action) { … }
base::Value::Dict DefaultsToValue(ExtensionAction* action) { … }
}
ExtensionActionStorageManager::ExtensionActionStorageManager(
content::BrowserContext* context)
: … { … }
ExtensionActionStorageManager::~ExtensionActionStorageManager() { … }
void ExtensionActionStorageManager::OnExtensionLoaded(
content::BrowserContext* browser_context,
const Extension* extension) { … }
void ExtensionActionStorageManager::OnExtensionActionUpdated(
ExtensionAction* extension_action,
content::WebContents* web_contents,
content::BrowserContext* browser_context) { … }
void ExtensionActionStorageManager::OnExtensionActionAPIShuttingDown() { … }
void ExtensionActionStorageManager::WriteToStorage(
ExtensionAction* extension_action) { … }
void ExtensionActionStorageManager::ReadFromStorage(
const ExtensionId& extension_id,
std::optional<base::Value> value) { … }
StateStore* ExtensionActionStorageManager::GetStateStore() { … }
}