#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/ui/prefs/pref_watcher.h"
#include "base/functional/bind.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/privacy_sandbox/tracking_protection_settings_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_preferences_util.h"
#include "chrome/browser/ui/prefs/prefs_tab_helper.h"
#include "chrome/common/pref_names.h"
#include "components/language/core/browser/pref_names.h"
#include "components/live_caption/pref_names.h"
#include "components/privacy_sandbox/tracking_protection_settings.h"
#include "third_party/blink/public/common/renderer_preferences/renderer_preferences.h"
#include "ui/native_theme/native_theme.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/constants/ash_pref_names.h"
#endif
#if BUILDFLAG(IS_ANDROID)
#include "components/browser_ui/accessibility/android/font_size_prefs_android.h"
#endif
namespace {
const char* const kWebPrefsToObserve[] = …;
const int kWebPrefsToObserveLength = …;
}
PrefWatcher::PrefWatcher(Profile* profile)
: … { … }
PrefWatcher::~PrefWatcher() = default;
void PrefWatcher::RegisterHelper(PrefsTabHelper* helper) { … }
void PrefWatcher::UnregisterHelper(PrefsTabHelper* helper) { … }
void PrefWatcher::RegisterRendererPreferenceWatcher(
mojo::PendingRemote<blink::mojom::RendererPreferenceWatcher> watcher) { … }
void PrefWatcher::Shutdown() { … }
void PrefWatcher::OnNativeThemeUpdated(
ui::NativeTheme* observed_theme) { … }
void PrefWatcher::OnDoNotTrackEnabledChanged() { … }
void PrefWatcher::UpdateRendererPreferences() { … }
void PrefWatcher::OnWebPrefChanged(const std::string& pref_name) { … }
PrefWatcher* PrefWatcherFactory::GetForProfile(Profile* profile) { … }
PrefWatcherFactory* PrefWatcherFactory::GetInstance() { … }
PrefWatcherFactory::PrefWatcherFactory()
: … { … }
PrefWatcherFactory::~PrefWatcherFactory() = default;
std::unique_ptr<KeyedService>
PrefWatcherFactory::BuildServiceInstanceForBrowserContext(
content::BrowserContext* browser_context) const { … }
PrefWatcher* PrefWatcher::Get(Profile* profile) { … }