1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
// Copyright 2025 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_SAFE_BROWSING_GENERATED_SECURITY_SETTINGS_BUNDLE_PREF_H_
#define CHROME_BROWSER_SAFE_BROWSING_GENERATED_SECURITY_SETTINGS_BUNDLE_PREF_H_
#include "base/memory/raw_ptr.h"
#include "chrome/browser/extensions/api/settings_private/generated_pref.h"
#include "chrome/browser/profiles/profile.h"
#include "components/prefs/pref_change_registrar.h"
namespace safe_browsing {
extern const char kGeneratedSecuritySettingsBundlePref[];
// Must be kept in sync with the SecuritySettingsBundle enum located in
// chrome/browser/resources/settings/privacy_page/security_page_v2.js.
// LINT.IfChange(SecuritySettingsBundleSetting)
enum class SecuritySettingsBundleSetting {
// Standard bundle with default settings.
STANDARD = 0,
// Enhanced bundle with most secure settings selected.
ENHANCED = 1,
};
// LINT.ThenChange(/chrome/browser/resources/settings/privacy_page/security_page_v2.ts:SecuritySettingsBundleSetting)
// A generated preference which represents the effective Security Settings
// Bundled state based on the underlying Security Settings Bundle preference.
// This preference allows the direct use of WebUI controls without exposing any
// logic responsible for coalescing the underlying Security Setting Bundled pref
// to front-end code.
class GeneratedSecuritySettingsBundlePref
: public extensions::settings_private::GeneratedPref {
public:
explicit GeneratedSecuritySettingsBundlePref(Profile* profile);
// Generated Preference Interface.
extensions::settings_private::SetPrefResult SetPref(
const base::Value* value) override;
extensions::api::settings_private::PrefObject GetPrefObject() const override;
// Fired when one of the bundle levels are changed.
void OnSecuritySettingsBundlePreferencesChanged();
private:
// Weak reference to the profile this preference is generated for.
const raw_ptr<Profile> profile_;
PrefChangeRegistrar user_prefs_registrar_;
};
} // namespace safe_browsing
#endif // CHROME_BROWSER_SAFE_BROWSING_GENERATED_SECURITY_SETTINGS_BUNDLE_PREF_H_
|