chromium/chrome/browser/font_pref_change_notifier.h

// Copyright 2017 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_FONT_PREF_CHANGE_NOTIFIER_H_
#define CHROME_BROWSER_FONT_PREF_CHANGE_NOTIFIER_H_

#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/observer_list.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/prefs/pref_observer.h"

class PrefService;

// There are more than 1000 font prefs and several subsystems need to be
// notified when a font changes. Registering for 1000 font change notifications
// is inefficient and slows down other pref notifications, and having each font
// subsystem registering "any preference changed" observers is also
// inefficient.
//
// This class registers for "any preference changed" notifications, filters
// for font pref changes only, and then issues notifications to registered
// observers.
//
// There is one FontPrefChangeNotifier per Profile. Construct one with the
// FontPrefChangeNotifierFactory.
class FontPrefChangeNotifier : public PrefObserver, public KeyedService {};

#endif  // CHROME_BROWSER_FONT_PREF_CHANGE_NOTIFIER_H_