OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/prefs/browser_prefs.h" | 5 #include "chrome/browser/prefs/browser_prefs.h" |
6 | 6 |
7 #include "chrome/browser/about_flags.h" | 7 #include "chrome/browser/about_flags.h" |
8 #include "chrome/browser/autofill/autofill_manager.h" | 8 #include "chrome/browser/autofill/autofill_manager.h" |
9 #include "chrome/browser/background_contents_service.h" | 9 #include "chrome/browser/background_contents_service.h" |
10 #include "chrome/browser/background_mode_manager.h" | 10 #include "chrome/browser/background_mode_manager.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "chrome/browser/intranet_redirect_detector.h" | 29 #include "chrome/browser/intranet_redirect_detector.h" |
30 #include "chrome/browser/metrics/metrics_log.h" | 30 #include "chrome/browser/metrics/metrics_log.h" |
31 #include "chrome/browser/metrics/metrics_service.h" | 31 #include "chrome/browser/metrics/metrics_service.h" |
32 #include "chrome/browser/net/net_pref_observer.h" | 32 #include "chrome/browser/net/net_pref_observer.h" |
33 #include "chrome/browser/net/predictor_api.h" | 33 #include "chrome/browser/net/predictor_api.h" |
34 #include "chrome/browser/net/pref_proxy_config_service.h" | 34 #include "chrome/browser/net/pref_proxy_config_service.h" |
35 #include "chrome/browser/notifications/desktop_notification_service.h" | 35 #include "chrome/browser/notifications/desktop_notification_service.h" |
36 #include "chrome/browser/notifications/notification_ui_manager.h" | 36 #include "chrome/browser/notifications/notification_ui_manager.h" |
37 #include "chrome/browser/page_info_model.h" | 37 #include "chrome/browser/page_info_model.h" |
38 #include "chrome/browser/password_manager/password_manager.h" | 38 #include "chrome/browser/password_manager/password_manager.h" |
| 39 #include "chrome/browser/policy/browser_policy_context.h" |
39 #include "chrome/browser/policy/profile_policy_context.h" | 40 #include "chrome/browser/policy/profile_policy_context.h" |
40 #include "chrome/browser/prefs/session_startup_pref.h" | 41 #include "chrome/browser/prefs/session_startup_pref.h" |
41 #include "chrome/browser/profiles/profile_impl.h" | 42 #include "chrome/browser/profiles/profile_impl.h" |
42 #include "chrome/browser/renderer_host/browser_render_process_host.h" | 43 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
43 #include "chrome/browser/renderer_host/web_cache_manager.h" | 44 #include "chrome/browser/renderer_host/web_cache_manager.h" |
44 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 45 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
45 #include "chrome/browser/search_engines/keyword_editor_controller.h" | 46 #include "chrome/browser/search_engines/keyword_editor_controller.h" |
46 #include "chrome/browser/search_engines/template_url_model.h" | 47 #include "chrome/browser/search_engines/template_url_model.h" |
47 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" | 48 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
48 #include "chrome/browser/ssl/ssl_manager.h" | 49 #include "chrome/browser/ssl/ssl_manager.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 browser_shutdown::RegisterPrefs(local_state); | 98 browser_shutdown::RegisterPrefs(local_state); |
98 #if defined(TOOLKIT_VIEWS) | 99 #if defined(TOOLKIT_VIEWS) |
99 BrowserView::RegisterBrowserViewPrefs(local_state); | 100 BrowserView::RegisterBrowserViewPrefs(local_state); |
100 #endif | 101 #endif |
101 UpgradeDetector::RegisterPrefs(local_state); | 102 UpgradeDetector::RegisterPrefs(local_state); |
102 TaskManager::RegisterPrefs(local_state); | 103 TaskManager::RegisterPrefs(local_state); |
103 geolocation::RegisterPrefs(local_state); | 104 geolocation::RegisterPrefs(local_state); |
104 AutoFillManager::RegisterBrowserPrefs(local_state); | 105 AutoFillManager::RegisterBrowserPrefs(local_state); |
105 BackgroundPageTracker::RegisterPrefs(local_state); | 106 BackgroundPageTracker::RegisterPrefs(local_state); |
106 NotificationUIManager::RegisterPrefs(local_state); | 107 NotificationUIManager::RegisterPrefs(local_state); |
| 108 policy::BrowserPolicyContext::RegisterPrefs(local_state); |
107 #if defined(OS_CHROMEOS) | 109 #if defined(OS_CHROMEOS) |
108 chromeos::AudioMixerAlsa::RegisterPrefs(local_state); | 110 chromeos::AudioMixerAlsa::RegisterPrefs(local_state); |
109 chromeos::UserManager::RegisterPrefs(local_state); | 111 chromeos::UserManager::RegisterPrefs(local_state); |
110 chromeos::UserCrosSettingsProvider::RegisterPrefs(local_state); | 112 chromeos::UserCrosSettingsProvider::RegisterPrefs(local_state); |
111 WizardController::RegisterPrefs(local_state); | 113 WizardController::RegisterPrefs(local_state); |
112 chromeos::InputMethodMenu::RegisterPrefs(local_state); | 114 chromeos::InputMethodMenu::RegisterPrefs(local_state); |
113 chromeos::ApplyServicesCustomization::RegisterPrefs(local_state); | 115 chromeos::ApplyServicesCustomization::RegisterPrefs(local_state); |
114 chromeos::SignedSettingsTempStorage::RegisterPrefs(local_state); | 116 chromeos::SignedSettingsTempStorage::RegisterPrefs(local_state); |
115 #endif | 117 #endif |
116 } | 118 } |
(...skipping 29 matching lines...) Expand all Loading... |
146 BrowserWindowGtk::RegisterUserPrefs(user_prefs); | 148 BrowserWindowGtk::RegisterUserPrefs(user_prefs); |
147 #endif | 149 #endif |
148 #if defined(OS_CHROMEOS) | 150 #if defined(OS_CHROMEOS) |
149 chromeos::Preferences::RegisterUserPrefs(user_prefs); | 151 chromeos::Preferences::RegisterUserPrefs(user_prefs); |
150 #endif | 152 #endif |
151 BackgroundContentsService::RegisterUserPrefs(user_prefs); | 153 BackgroundContentsService::RegisterUserPrefs(user_prefs); |
152 SigninManager::RegisterUserPrefs(user_prefs); | 154 SigninManager::RegisterUserPrefs(user_prefs); |
153 TemplateURLModel::RegisterUserPrefs(user_prefs); | 155 TemplateURLModel::RegisterUserPrefs(user_prefs); |
154 InstantController::RegisterUserPrefs(user_prefs); | 156 InstantController::RegisterUserPrefs(user_prefs); |
155 NetPrefObserver::RegisterPrefs(user_prefs); | 157 NetPrefObserver::RegisterPrefs(user_prefs); |
156 policy::ProfilePolicyContext::RegisterUserPrefs(user_prefs); | 158 policy::ProfilePolicyContext::RegisterPrefs(user_prefs); |
157 } | 159 } |
158 | 160 |
159 void MigrateBrowserPrefs(PrefService* user_prefs, PrefService* local_state) { | 161 void MigrateBrowserPrefs(PrefService* user_prefs, PrefService* local_state) { |
160 // Copy pref values which have been migrated to user_prefs from local_state, | 162 // Copy pref values which have been migrated to user_prefs from local_state, |
161 // or remove them from local_state outright, if copying is not required. | 163 // or remove them from local_state outright, if copying is not required. |
162 int current_version = | 164 int current_version = |
163 local_state->GetInteger(prefs::kMultipleProfilePrefMigration); | 165 local_state->GetInteger(prefs::kMultipleProfilePrefMigration); |
164 | 166 |
165 if ((current_version & WINDOWS_PREFS) == 0) { | 167 if ((current_version & WINDOWS_PREFS) == 0) { |
166 // Migrate the devtools split location preference. | 168 // Migrate the devtools split location preference. |
(...skipping 14 matching lines...) Expand all Loading... |
181 GetValue()->DeepCopy())); | 183 GetValue()->DeepCopy())); |
182 } | 184 } |
183 local_state->ClearPref(prefs::kBrowserWindowPlacement); | 185 local_state->ClearPref(prefs::kBrowserWindowPlacement); |
184 | 186 |
185 local_state->SetInteger(prefs::kMultipleProfilePrefMigration, | 187 local_state->SetInteger(prefs::kMultipleProfilePrefMigration, |
186 current_version | WINDOWS_PREFS); | 188 current_version | WINDOWS_PREFS); |
187 } | 189 } |
188 } | 190 } |
189 | 191 |
190 } // namespace browser | 192 } // namespace browser |
OLD | NEW |