# Class TCefPreferenceManagerRef

Description
Hierarchy
Methods

## Unit

uCEFPreferenceManager

## Declaration

`type TCefPreferenceManagerRef = class(TCefBaseRefCountedRef, ICefPreferenceManager)`

## Description

Manage access to preferences. Many built-in preferences are registered by Chromium. Custom preferences can be registered in ICefBrowserProcessHandler.OnRegisterCustomPreferences.

<see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_preference_capi.h">CEF source file: /include/capi/cef_preference_capi.h (cef_preference_manager_t))

## Hierarchy

- TInterfacedObject
- TCefBaseRefCountedRef
- TCefPreferenceManagerRef

## Overview

### Methods

Protected | `function HasPreference(const name: ustring): Boolean;`
Protected | `function GetPreference(const name: ustring): ICefValue;`
Protected | `function GetAllPreferences(includeDefaults: Boolean): ICefDictionaryValue;`
Protected | `function CanSetPreference(const name: ustring): Boolean;`
Protected | `function SetPreference(const name: ustring; const value: ICefValue; out error: ustring): Boolean;`
Protected | `function AddPreferenceObserver(const name: ustring; const observer: ICefPreferenceObserver): ICefRegistration;`
Public | `class function UnWrap(data: Pointer): ICefPreferenceManager;`
Public | `class function Global: ICefPreferenceManager;`
Public | `class procedure GetChromeVariationsAsSwitches(const switches: TStrings);`
Public | `class procedure GetChromeVariationsAsStrings(const strings: TStrings);`

## Description

### Methods

Protected | `function HasPreference(const name: ustring): Boolean;`
Returns true (1) if a preference with the specified |name| exists. This function must be called on the browser process UI thread.

Protected | `function GetPreference(const name: ustring): ICefValue;`
Returns the value for the preference with the specified |name|. Returns NULL if the preference does not exist. The returned object contains a copy of the underlying preference value and modifications to the returned object will not modify the underlying preference value. This function must be called on the browser process UI thread.

Protected | `function GetAllPreferences(includeDefaults: Boolean): ICefDictionaryValue;`
Returns the value for the preference with the specified |name|. Returns NULL if the preference does not exist. The returned object contains a copy of the underlying preference value and modifications to the returned object will not modify the underlying preference value. This function must be called on the browser process UI thread.

Protected | `function CanSetPreference(const name: ustring): Boolean;`
Returns true (1) if the preference with the specified |name| can be modified using SetPreference. As one example preferences set via the command-line usually cannot be modified. This function must be called on the browser process UI thread.

Protected | `function SetPreference(const name: ustring; const value: ICefValue; out error: ustring): Boolean;`
Returns true (1) if the preference with the specified |name| can be modified using SetPreference. As one example preferences set via the command-line usually cannot be modified. This function must be called on the browser process UI thread.

Protected | `function AddPreferenceObserver(const name: ustring; const observer: ICefPreferenceObserver): ICefRegistration;`
Add an observer for preference changes. |name| is the name of the preference to observe. If |name| is NULL then all preferences will be observed. Observing all preferences has performance consequences and is not recommended outside of testing scenarios. The observer will remain registered until the returned Registration object is destroyed. This function must be called on the browser process UI thread.

Public | `class function UnWrap(data: Pointer): ICefPreferenceManager;`
This item has no description.

Public | `class function Global: ICefPreferenceManager;`
Returns the global preference manager object.

Public | `class procedure GetChromeVariationsAsSwitches(const switches: TStrings);`
Returns the current Chrome Variations configuration (combination of field trials and chrome://flags) as equivalent command-line switches (`–[enable|disable]-features=XXXX`, etc). These switches can be used to apply the same configuration when launching a CEF-based application. See https://developer.chrome.com/docs/web-platform/chrome-variations for background and details. Note that field trial tests are disabled by default in Official CEF builds (via the `disable_fieldtrial_testing_config=true (1)` GN flag). This function must be called on the browser process UI thread.

Public | `class procedure GetChromeVariationsAsStrings(const strings: TStrings);`
Returns the current Chrome Variations configuration (combination of field trials and chrome://flags) as human-readable strings. This is the human- readable equivalent of the "Active Variations" section of chrome://version. See https://developer.chrome.com/docs/web-platform/chrome-variations for background and details. Note that field trial tests are disabled by default in Official CEF builds (via the `disable_fieldtrial_testing_config=true (1)` GN flag). This function must be called on the browser process UI thread.

Generated by PasDoc 1.0.4.