| 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/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/trace_event/trace_event.h" | 11 #include "base/trace_event/trace_event.h" |
| 11 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 12 #include "chrome/browser/about_flags.h" | 13 #include "chrome/browser/about_flags.h" |
| 13 #include "chrome/browser/accessibility/invert_bubble_prefs.h" | 14 #include "chrome/browser/accessibility/invert_bubble_prefs.h" |
| 14 #include "chrome/browser/browser_process_impl.h" | 15 #include "chrome/browser/browser_process_impl.h" |
| 15 #include "chrome/browser/browser_shutdown.h" | 16 #include "chrome/browser/browser_shutdown.h" |
| 16 #include "chrome/browser/budget_service/background_budget_service.h" | 17 #include "chrome/browser/budget_service/background_budget_service.h" |
| 17 #include "chrome/browser/chrome_content_browser_client.h" | 18 #include "chrome/browser/chrome_content_browser_client.h" |
| 18 #include "chrome/browser/component_updater/recovery_component_installer.h" | 19 #include "chrome/browser/component_updater/recovery_component_installer.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 #include "components/search_engines/template_url_prepopulate_data.h" | 93 #include "components/search_engines/template_url_prepopulate_data.h" |
| 93 #include "components/ssl_config/ssl_config_service_manager.h" | 94 #include "components/ssl_config/ssl_config_service_manager.h" |
| 94 #include "components/startup_metric_utils/browser/startup_metric_utils.h" | 95 #include "components/startup_metric_utils/browser/startup_metric_utils.h" |
| 95 #include "components/subresource_filter/core/browser/ruleset_service.h" | 96 #include "components/subresource_filter/core/browser/ruleset_service.h" |
| 96 #include "components/sync_driver/sync_prefs.h" | 97 #include "components/sync_driver/sync_prefs.h" |
| 97 #include "components/syncable_prefs/pref_service_syncable.h" | 98 #include "components/syncable_prefs/pref_service_syncable.h" |
| 98 #include "components/translate/core/browser/translate_prefs.h" | 99 #include "components/translate/core/browser/translate_prefs.h" |
| 99 #include "components/update_client/update_client.h" | 100 #include "components/update_client/update_client.h" |
| 100 #include "components/variations/service/variations_service.h" | 101 #include "components/variations/service/variations_service.h" |
| 101 #include "components/web_resource/promo_resource_service.h" | 102 #include "components/web_resource/promo_resource_service.h" |
| 103 #include "content/public/browser/browser_thread.h" |
| 102 #include "content/public/browser/render_process_host.h" | 104 #include "content/public/browser/render_process_host.h" |
| 103 #include "net/http/http_server_properties_manager.h" | 105 #include "net/http/http_server_properties_manager.h" |
| 104 | 106 |
| 105 #if BUILDFLAG(ENABLE_BACKGROUND) | 107 #if BUILDFLAG(ENABLE_BACKGROUND) |
| 106 #include "chrome/browser/background/background_mode_manager.h" | 108 #include "chrome/browser/background/background_mode_manager.h" |
| 107 #endif | 109 #endif |
| 108 | 110 |
| 109 #if defined(ENABLE_EXTENSIONS) | 111 #if defined(ENABLE_EXTENSIONS) |
| 110 #include "chrome/browser/accessibility/animation_policy_prefs.h" | 112 #include "chrome/browser/accessibility/animation_policy_prefs.h" |
| 111 #include "chrome/browser/apps/shortcut_manager.h" | 113 #include "chrome/browser/apps/shortcut_manager.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 "googlegeolocationaccess.enabled"; | 291 "googlegeolocationaccess.enabled"; |
| 290 #endif | 292 #endif |
| 291 | 293 |
| 292 // Deprecated 4/2016. | 294 // Deprecated 4/2016. |
| 293 const char kCheckDefaultBrowser[] = "browser.check_default_browser"; | 295 const char kCheckDefaultBrowser[] = "browser.check_default_browser"; |
| 294 | 296 |
| 295 // Deprecated 5/2016. | 297 // Deprecated 5/2016. |
| 296 const char kDesktopSearchRedirectionInfobarShownPref[] = | 298 const char kDesktopSearchRedirectionInfobarShownPref[] = |
| 297 "desktop_search_redirection_infobar_shown"; | 299 "desktop_search_redirection_infobar_shown"; |
| 298 | 300 |
| 301 void DeleteWebRTCIdentityStoreDBOnFileThread(base::FilePath profile_path) { |
| 302 base::DeleteFile(profile_path.Append( |
| 303 FILE_PATH_LITERAL("WebRTCIdentityStore")), false); |
| 304 base::DeleteFile(profile_path.Append( |
| 305 FILE_PATH_LITERAL("WebRTCIdentityStore-journal")), false); |
| 306 } |
| 307 |
| 308 void DeleteWebRTCIdentityStoreDB(Profile* profile) { |
| 309 content::BrowserThread::PostDelayedTask( |
| 310 content::BrowserThread::FILE, |
| 311 FROM_HERE, |
| 312 base::Bind(&DeleteWebRTCIdentityStoreDBOnFileThread, profile->GetPath()), |
| 313 base::TimeDelta::FromSeconds(120)); |
| 314 } |
| 315 |
| 299 } // namespace | 316 } // namespace |
| 300 | 317 |
| 301 namespace chrome { | 318 namespace chrome { |
| 302 | 319 |
| 303 void RegisterLocalState(PrefRegistrySimple* registry) { | 320 void RegisterLocalState(PrefRegistrySimple* registry) { |
| 304 // Please keep this list alphabetized. | 321 // Please keep this list alphabetized. |
| 305 AppListService::RegisterPrefs(registry); | 322 AppListService::RegisterPrefs(registry); |
| 306 browser_shutdown::RegisterPrefs(registry); | 323 browser_shutdown::RegisterPrefs(registry); |
| 307 BrowserProcessImpl::RegisterPrefs(registry); | 324 BrowserProcessImpl::RegisterPrefs(registry); |
| 308 ChromeMetricsServiceClient::RegisterPrefs(registry); | 325 ChromeMetricsServiceClient::RegisterPrefs(registry); |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 metrics_service | 723 metrics_service |
| 707 ? base::Time::FromTimeT(metrics_service->GetInstallDate()) | 724 ? base::Time::FromTimeT(metrics_service->GetInstallDate()) |
| 708 : base::Time::Now(); | 725 : base::Time::Now(); |
| 709 profile_prefs->SetInt64(prefs::kDefaultBrowserLastDeclined, | 726 profile_prefs->SetInt64(prefs::kDefaultBrowserLastDeclined, |
| 710 install_time.ToInternalValue()); | 727 install_time.ToInternalValue()); |
| 711 } | 728 } |
| 712 profile_prefs->ClearPref(kCheckDefaultBrowser); | 729 profile_prefs->ClearPref(kCheckDefaultBrowser); |
| 713 | 730 |
| 714 // Added 5/2016. | 731 // Added 5/2016. |
| 715 profile_prefs->ClearPref(kDesktopSearchRedirectionInfobarShownPref); | 732 profile_prefs->ClearPref(kDesktopSearchRedirectionInfobarShownPref); |
| 733 |
| 734 // Added 7/2016. |
| 735 DeleteWebRTCIdentityStoreDB(profile); |
| 716 } | 736 } |
| 717 | 737 |
| 718 } // namespace chrome | 738 } // namespace chrome |
| OLD | NEW |