OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
255 #endif | 255 #endif |
256 | 256 |
257 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 257 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
258 #include "chrome/browser/ui/webui/md_history_ui.h" | 258 #include "chrome/browser/ui/webui/md_history_ui.h" |
259 #endif | 259 #endif |
260 | 260 |
261 namespace { | 261 namespace { |
262 | 262 |
263 #if BUILDFLAG(ENABLE_GOOGLE_NOW) | 263 #if BUILDFLAG(ENABLE_GOOGLE_NOW) |
264 // Deprecated 3/2016 | 264 // Deprecated 3/2016 |
265 const char kGoogleGeolocationAccessEnabled[] = | 265 constexpr char kGoogleGeolocationAccessEnabled[] = |
266 "googlegeolocationaccess.enabled"; | 266 "googlegeolocationaccess.enabled"; |
267 #endif | 267 #endif |
268 | 268 |
269 // Deprecated 4/2016. | 269 // Deprecated 4/2016. |
270 const char kCheckDefaultBrowser[] = "browser.check_default_browser"; | 270 constexpr char kCheckDefaultBrowser[] = "browser.check_default_browser"; |
271 | 271 |
272 // Deprecated 5/2016. | 272 // Deprecated 5/2016. |
273 const char kDesktopSearchRedirectionInfobarShownPref[] = | 273 constexpr char kDesktopSearchRedirectionInfobarShownPref[] = |
274 "desktop_search_redirection_infobar_shown"; | 274 "desktop_search_redirection_infobar_shown"; |
275 | 275 |
276 // Deprecated 7/2016. | 276 // Deprecated 7/2016. |
277 const char kNetworkPredictionEnabled[] = "dns_prefetching.enabled"; | 277 constexpr char kNetworkPredictionEnabled[] = "dns_prefetching.enabled"; |
278 const char kDisableSpdy[] = "spdy.disabled"; | 278 constexpr char kDisableSpdy[] = "spdy.disabled"; |
279 | 279 |
280 // Deprecated 8/2016. | 280 // Deprecated 8/2016. |
281 const char kRecentlySelectedEncoding[] = "profile.recently_selected_encodings"; | 281 constexpr char kRecentlySelectedEncoding[] = "profile.recently_selected_encoding s"; |
282 const char kStaticEncodings[] = "intl.static_encodings"; | 282 constexpr char kStaticEncodings[] = "intl.static_encodings"; |
283 | 283 |
284 // Deprecated 9/2016. | 284 // Deprecated 9/2016. |
285 const char kWebKitUsesUniversalDetector[] = | 285 constexpr char kWebKitUsesUniversalDetector[] = |
286 "webkit.webprefs.uses_universal_detector"; | 286 "webkit.webprefs.uses_universal_detector"; |
287 const char kWebKitAllowDisplayingInsecureContent[] = | 287 constexpr char kWebKitAllowDisplayingInsecureContent[] = |
288 "webkit.webprefs.allow_displaying_insecure_content"; | 288 "webkit.webprefs.allow_displaying_insecure_content"; |
289 | 289 |
290 #if BUILDFLAG(ENABLE_EXTENSIONS) | 290 #if BUILDFLAG(ENABLE_EXTENSIONS) |
291 // Deprecated 2/2017. | 291 // Deprecated 2/2017. |
292 const char kToolbarMigratedComponentActionStatus[] = | 292 constexpr char kToolbarMigratedComponentActionStatus[] = |
293 "toolbar_migrated_component_action_status"; | 293 "toolbar_migrated_component_action_status"; |
294 #endif | 294 #endif |
295 | 295 |
296 // master_preferences used to be mapped as-is to Preferences on first run but | |
297 // the "distribution" dictionary was never used beyond first run. It is now | |
298 // stripped in first_run.cc prior to applying this mapping. Cleanup for existing | |
299 // Preferences files added here 2/2017. | |
300 constexpr char kDistroDict[] = "distribution"; | |
301 | |
296 void DeleteWebRTCIdentityStoreDBOnFileThread( | 302 void DeleteWebRTCIdentityStoreDBOnFileThread( |
297 const base::FilePath& profile_path) { | 303 const base::FilePath& profile_path) { |
298 base::DeleteFile(profile_path.Append( | 304 base::DeleteFile(profile_path.Append( |
299 FILE_PATH_LITERAL("WebRTCIdentityStore")), false); | 305 FILE_PATH_LITERAL("WebRTCIdentityStore")), false); |
300 base::DeleteFile(profile_path.Append( | 306 base::DeleteFile(profile_path.Append( |
301 FILE_PATH_LITERAL("WebRTCIdentityStore-journal")), false); | 307 FILE_PATH_LITERAL("WebRTCIdentityStore-journal")), false); |
302 } | 308 } |
303 | 309 |
304 void DeleteWebRTCIdentityStoreDB(const Profile& profile) { | 310 void DeleteWebRTCIdentityStoreDB(const Profile& profile) { |
305 content::BrowserThread::PostDelayedTask( | 311 content::BrowserThread::PostDelayedTask( |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
633 registry->RegisterBooleanPref(kDisableSpdy, false); | 639 registry->RegisterBooleanPref(kDisableSpdy, false); |
634 registry->RegisterStringPref(kStaticEncodings, std::string()); | 640 registry->RegisterStringPref(kStaticEncodings, std::string()); |
635 registry->RegisterStringPref(kRecentlySelectedEncoding, std::string()); | 641 registry->RegisterStringPref(kRecentlySelectedEncoding, std::string()); |
636 registry->RegisterBooleanPref(kWebKitUsesUniversalDetector, true); | 642 registry->RegisterBooleanPref(kWebKitUsesUniversalDetector, true); |
637 | 643 |
638 registry->RegisterBooleanPref(kWebKitAllowDisplayingInsecureContent, true); | 644 registry->RegisterBooleanPref(kWebKitAllowDisplayingInsecureContent, true); |
639 | 645 |
640 #if BUILDFLAG(ENABLE_EXTENSIONS) | 646 #if BUILDFLAG(ENABLE_EXTENSIONS) |
641 registry->RegisterDictionaryPref(kToolbarMigratedComponentActionStatus); | 647 registry->RegisterDictionaryPref(kToolbarMigratedComponentActionStatus); |
642 #endif | 648 #endif |
649 | |
650 registry->RegisterDictionaryPref(kDistroDict); | |
643 } | 651 } |
644 | 652 |
645 void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 653 void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
646 RegisterProfilePrefs(registry); | 654 RegisterProfilePrefs(registry); |
647 | 655 |
648 #if defined(OS_CHROMEOS) | 656 #if defined(OS_CHROMEOS) |
649 chromeos::PowerPrefs::RegisterUserProfilePrefs(registry); | 657 chromeos::PowerPrefs::RegisterUserProfilePrefs(registry); |
650 #endif | 658 #endif |
651 | 659 |
652 #if defined(OS_ANDROID) | 660 #if defined(OS_ANDROID) |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
725 profile_prefs->ClearPref(kRecentlySelectedEncoding); | 733 profile_prefs->ClearPref(kRecentlySelectedEncoding); |
726 | 734 |
727 // Added 9/2016. | 735 // Added 9/2016. |
728 profile_prefs->ClearPref(kWebKitUsesUniversalDetector); | 736 profile_prefs->ClearPref(kWebKitUsesUniversalDetector); |
729 profile_prefs->ClearPref(kWebKitAllowDisplayingInsecureContent); | 737 profile_prefs->ClearPref(kWebKitAllowDisplayingInsecureContent); |
730 | 738 |
731 #if BUILDFLAG(ENABLE_EXTENSIONS) | 739 #if BUILDFLAG(ENABLE_EXTENSIONS) |
732 // Added 2/2017. | 740 // Added 2/2017. |
733 profile_prefs->ClearPref(kToolbarMigratedComponentActionStatus); | 741 profile_prefs->ClearPref(kToolbarMigratedComponentActionStatus); |
734 #endif | 742 #endif |
743 | |
744 // Added 2/2017. | |
745 profile_prefs->ClearPref(kDistroDict); | |
grt (UTC plus 2)
2017/02/23 21:19:01
can't do this because of PingDelay :-(
gab
2017/02/23 23:27:53
Fixed in precursor CL.
| |
735 } | 746 } |
736 | 747 |
737 } // namespace chrome | 748 } // namespace chrome |
OLD | NEW |