BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / chrome / browser / ui / browser_ui_prefs.cc
blob1b25184cc7243293041b90bb108422d1a8d4a53f
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/browser_ui_prefs.h"
7 #include "base/prefs/pref_registry_simple.h"
8 #include "base/prefs/pref_service.h"
9 #include "base/prefs/scoped_user_pref_update.h"
10 #include "chrome/browser/first_run/first_run.h"
11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/common/pref_names.h"
13 #include "components/pref_registry/pref_registry_syncable.h"
14 #include "components/translate/core/common/translate_pref_names.h"
16 namespace chrome {
18 void RegisterBrowserPrefs(PrefRegistrySimple* registry) {
19 registry->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0);
20 registry->RegisterBooleanPref(prefs::kAllowFileSelectionDialogs, true);
21 registry->RegisterIntegerPref(prefs::kShowFirstRunBubbleOption,
22 first_run::FIRST_RUN_BUBBLE_DONT_SHOW);
25 void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
26 registry->RegisterBooleanPref(
27 prefs::kHomePageIsNewTabPage,
28 true,
29 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
30 registry->RegisterBooleanPref(
31 prefs::kShowHomeButton,
32 false,
33 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
34 #if defined(OS_MACOSX)
35 // This really belongs in platform code, but there's no good place to
36 // initialize it between the time when the AppController is created
37 // (where there's no profile) and the time the controller gets another
38 // crack at the start of the main event loop. By that time,
39 // StartupBrowserCreator has already created the browser window, and it's too
40 // late: we need the pref to be already initialized. Doing it here also saves
41 // us from having to hard-code pref registration in the several unit tests
42 // that use this preference.
43 registry->RegisterBooleanPref(prefs::kShowUpdatePromotionInfoBar, true);
44 #endif
45 registry->RegisterBooleanPref(
46 prefs::kDeleteBrowsingHistory,
47 true,
48 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
49 registry->RegisterBooleanPref(
50 prefs::kDeleteDownloadHistory,
51 true,
52 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
53 registry->RegisterBooleanPref(
54 prefs::kDeleteCache,
55 true,
56 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
57 registry->RegisterBooleanPref(
58 prefs::kDeleteCookies,
59 true,
60 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
61 registry->RegisterBooleanPref(
62 prefs::kDeletePasswords,
63 false,
64 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
65 registry->RegisterBooleanPref(
66 prefs::kDeleteFormData,
67 false,
68 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
69 registry->RegisterBooleanPref(
70 prefs::kDeleteHostedAppsData,
71 false,
72 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
73 registry->RegisterIntegerPref(
74 prefs::kDeleteTimePeriod,
76 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
77 registry->RegisterInt64Pref(prefs::kLastClearBrowsingDataTime, 0);
78 registry->RegisterIntegerPref(prefs::kModuleConflictBubbleShown, 0);
79 registry->RegisterBooleanPref(prefs::kCheckDefaultBrowser, true);
80 registry->RegisterBooleanPref(prefs::kWebAppCreateOnDesktop, true);
81 registry->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true);
82 registry->RegisterBooleanPref(prefs::kWebAppCreateInQuickLaunchBar, true);
83 registry->RegisterBooleanPref(
84 prefs::kEnableTranslate,
85 true,
86 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
87 registry->RegisterStringPref(prefs::kCloudPrintEmail, std::string());
88 registry->RegisterBooleanPref(prefs::kCloudPrintProxyEnabled, true);
89 registry->RegisterBooleanPref(prefs::kCloudPrintSubmitEnabled, true);
90 registry->RegisterBooleanPref(prefs::kDevToolsDisabled, false);
91 registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacement);
92 registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacementPopup);
93 registry->RegisterDictionaryPref(prefs::kAppWindowPlacement);
94 registry->RegisterBooleanPref(prefs::kImportAutofillFormData, true);
95 registry->RegisterBooleanPref(prefs::kImportBookmarks, true);
96 registry->RegisterBooleanPref(prefs::kImportHistory, true);
97 registry->RegisterBooleanPref(prefs::kImportHomepage, true);
98 registry->RegisterBooleanPref(prefs::kImportSavedPasswords, true);
99 registry->RegisterBooleanPref(prefs::kImportSearchEngine, true);
100 registry->RegisterBooleanPref(
101 prefs::kEnableDoNotTrack,
102 false,
103 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
104 #if defined(ENABLE_WEBRTC)
105 registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, true);
106 registry->RegisterBooleanPref(prefs::kWebRTCNonProxiedUdpEnabled, true);
107 #endif
109 // Dictionaries to keep track of default tasks in the file browser.
110 registry->RegisterDictionaryPref(
111 prefs::kDefaultTasksByMimeType,
112 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
113 registry->RegisterDictionaryPref(
114 prefs::kDefaultTasksBySuffix,
115 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
117 // We need to register the type of these preferences in order to query
118 // them even though they're only typically controlled via policy.
119 registry->RegisterBooleanPref(prefs::kPluginsAllowOutdated, false);
120 registry->RegisterBooleanPref(prefs::kPluginsAlwaysAuthorize, false);
121 registry->RegisterBooleanPref(prefs::kClearPluginLSODataEnabled, true);
122 registry->RegisterBooleanPref(prefs::kHideWebStoreIcon, false);
123 #if !defined(OS_MACOSX)
124 registry->RegisterBooleanPref(prefs::kFullscreenAllowed, true);
125 #endif
128 } // namespace chrome