#include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h"
#include <stddef.h>
#include <memory>
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/json_pref_store.h"
#include "components/prefs/pref_filter.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service_factory.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/zoom/zoom_event_manager.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/host_zoom_map.h"
#include "third_party/blink/public/common/page/page_zoom.h"
namespace {
std::string GetPartitionKey(const base::FilePath& relative_path) { … }
const char kZoomLevelKey[] = …;
const char kLastModifiedPath[] = …;
base::Time GetTimeStamp(const base::Value::Dict& dictionary) { … }
}
ChromeZoomLevelPrefs::ChromeZoomLevelPrefs(
PrefService* pref_service,
const base::FilePath& profile_path,
const base::FilePath& partition_path,
base::WeakPtr<zoom::ZoomEventManager> zoom_event_manager)
: … { … }
ChromeZoomLevelPrefs::~ChromeZoomLevelPrefs() { … }
std::string ChromeZoomLevelPrefs::GetPartitionKeyForTesting(
const base::FilePath& relative_path) { … }
void ChromeZoomLevelPrefs::SetDefaultZoomLevelPref(double level) { … }
double ChromeZoomLevelPrefs::GetDefaultZoomLevelPref() const { … }
base::CallbackListSubscription
ChromeZoomLevelPrefs::RegisterDefaultZoomLevelCallback(
base::RepeatingClosure callback) { … }
void ChromeZoomLevelPrefs::OnZoomLevelChanged(
const content::HostZoomMap::ZoomLevelChange& change) { … }
void ChromeZoomLevelPrefs::ExtractPerHostZoomLevels(
const base::Value::Dict& host_zoom_dictionary,
bool sanitize_partition_host_zoom_levels) { … }
void ChromeZoomLevelPrefs::InitHostZoomMap(
content::HostZoomMap* host_zoom_map) { … }