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

#ifndef CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_AUTOFILL_SETTINGS_TRANSFORMER_H_
#define CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_AUTOFILL_SETTINGS_TRANSFORMER_H_

#include <optional>
#include <string>

#include "extensions/browser/pref_transformer_interface.h"
#include "extensions/buildflags/buildflags.h"

static_assert(BUILDFLAG(ENABLE_EXTENSIONS_CORE));

namespace base {
class Value;
}  // namespace base

namespace extensions {

// Transforms the autofillSettings extension API list of dictionary entries
// (camelCase keys) to browser preference structure (snake_case keys) and vice
// versa.
class AutofillSettingsTransformer : public PrefTransformerInterface {
 public:
  AutofillSettingsTransformer();
  ~AutofillSettingsTransformer() override;

  // PrefTransformerInterface:
  std::optional<base::Value> ExtensionToBrowserPref(
      const base::Value& extension_pref,
      std::string& error,
      bool& bad_message) override;
  std::optional<base::Value> BrowserToExtensionPref(
      const base::Value& browser_pref,
      bool is_incognito_profile) override;
};

}  // namespace extensions

#endif  // CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_AUTOFILL_SETTINGS_TRANSFORMER_H_
