This source file includes following definitions.
- RegisterBrowserPrefs
- RegisterBrowserUserPrefs
- RegisterAppPrefs
#include "chrome/browser/ui/browser_ui_prefs.h"
#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/pref_service.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "components/translate/core/common/translate_pref_names.h"
#include "components/user_prefs/pref_registry_syncable.h"
namespace chrome {
void RegisterBrowserPrefs(PrefRegistrySimple* registry) {
registry->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0);
registry->RegisterBooleanPref(prefs::kAllowFileSelectionDialogs, true);
registry->RegisterIntegerPref(prefs::kShowFirstRunBubbleOption,
first_run::FIRST_RUN_BUBBLE_DONT_SHOW);
}
void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
prefs::kHomePageIsNewTabPage,
true,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kShowHomeButton,
false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
#if defined(OS_MACOSX)
registry->RegisterBooleanPref(
prefs::kShowUpdatePromotionInfoBar,
true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#endif
registry->RegisterBooleanPref(
prefs::kDeleteBrowsingHistory,
true,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kDeleteDownloadHistory,
true,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kDeleteCache,
true,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kDeleteCookies,
true,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kDeletePasswords,
false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kDeleteFormData,
false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kDeleteHostedAppsData,
false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterIntegerPref(
prefs::kDeleteTimePeriod,
0,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterInt64Pref(
prefs::kLastClearBrowsingDataTime,
0,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterIntegerPref(prefs::kModuleConflictBubbleShown,
0,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kCheckDefaultBrowser,
true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#if defined(OS_WIN)
registry->RegisterBooleanPref(
prefs::kSuppressSwitchToMetroModeOnSetDefault,
false,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#endif
registry->RegisterBooleanPref(
prefs::kWebAppCreateOnDesktop,
true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kWebAppCreateInAppsMenu,
true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kWebAppCreateInQuickLaunchBar,
true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kEnableTranslate,
true,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterStringPref(
prefs::kCloudPrintEmail,
std::string(),
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kCloudPrintProxyEnabled,
true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kCloudPrintSubmitEnabled,
true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kDevToolsDisabled,
false,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterDictionaryPref(
prefs::kBrowserWindowPlacement,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterDictionaryPref(
prefs::kPreferencesWindowPlacement,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kImportBookmarks,
true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kImportHistory,
true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kImportHomepage,
true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kImportSearchEngine,
true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kImportSavedPasswords,
true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kEnableDoNotTrack,
false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterDictionaryPref(
prefs::kDefaultTasksByMimeType,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterDictionaryPref(
prefs::kDefaultTasksBySuffix,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kPluginsAllowOutdated,
false,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kPluginsAlwaysAuthorize,
false,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kClearPluginLSODataEnabled,
true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kHideWebStoreIcon,
false,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#if !defined(OS_MACOSX)
registry->RegisterBooleanPref(
prefs::kFullscreenAllowed,
true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#endif
}
void RegisterAppPrefs(const std::string& app_name, Profile* profile) {
std::string window_pref(prefs::kBrowserWindowPlacement);
window_pref.append("_");
window_pref.append(app_name);
PrefService* prefs = profile->GetPrefs();
if (!prefs->FindPreference(window_pref.c_str())) {
scoped_refptr<user_prefs::PrefRegistrySyncable> registry(
static_cast<user_prefs::PrefRegistrySyncable*>(
prefs->DeprecatedGetPrefRegistry()));
registry->RegisterDictionaryPref(
window_pref.c_str(), user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
}
}
}