Add Google SafeSearch support with NetworkService (see issue #1917)

This commit is contained in:
Marshall Greenblatt
2019-09-25 16:59:51 +03:00
parent 729b3f0a8f
commit bc5cbcf39b
9 changed files with 156 additions and 16 deletions

View File

@@ -29,6 +29,7 @@
#include "chrome/browser/ui/webui/print_preview/sticky_settings.h"
#include "chrome/common/buildflags.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/net/safe_search_util.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/locale_settings.h"
#include "components/certificate_transparency/pref_names.h"
@@ -232,6 +233,10 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
// Print preferences.
// Based on ProfileImpl::RegisterProfilePrefs.
registry->RegisterBooleanPref(prefs::kForceGoogleSafeSearch, false);
registry->RegisterIntegerPref(prefs::kForceYouTubeRestrict,
safe_search_util::YOUTUBE_RESTRICT_OFF);
registry->RegisterStringPref(prefs::kAllowedDomainsForApps, std::string());
registry->RegisterBooleanPref(prefs::kPrintingEnabled, true);
registry->RegisterBooleanPref(prefs::kPrintPreviewDisabled,
!extensions::PrintPreviewEnabled());