Chromium Code Reviews| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 #include "components/search_engines/template_url_prepopulate_data.h" | 91 #include "components/search_engines/template_url_prepopulate_data.h" |
| 91 #include "components/ssl_config/ssl_config_service_manager.h" | 92 #include "components/ssl_config/ssl_config_service_manager.h" |
| 92 #include "components/startup_metric_utils/browser/startup_metric_utils.h" | 93 #include "components/startup_metric_utils/browser/startup_metric_utils.h" |
| 93 #include "components/subresource_filter/core/browser/ruleset_service.h" | 94 #include "components/subresource_filter/core/browser/ruleset_service.h" |
| 94 #include "components/sync_driver/sync_prefs.h" | 95 #include "components/sync_driver/sync_prefs.h" |
| 95 #include "components/syncable_prefs/pref_service_syncable.h" | 96 #include "components/syncable_prefs/pref_service_syncable.h" |
| 96 #include "components/translate/core/browser/translate_prefs.h" | 97 #include "components/translate/core/browser/translate_prefs.h" |
| 97 #include "components/update_client/update_client.h" | 98 #include "components/update_client/update_client.h" |
| 98 #include "components/variations/service/variations_service.h" | 99 #include "components/variations/service/variations_service.h" |
| 99 #include "components/web_resource/promo_resource_service.h" | 100 #include "components/web_resource/promo_resource_service.h" |
| 101 #include "content/public/browser/browser_thread.h" | |
| 100 #include "content/public/browser/render_process_host.h" | 102 #include "content/public/browser/render_process_host.h" |
| 101 #include "net/http/http_server_properties_manager.h" | 103 #include "net/http/http_server_properties_manager.h" |
| 102 | 104 |
| 103 #if BUILDFLAG(ENABLE_BACKGROUND) | 105 #if BUILDFLAG(ENABLE_BACKGROUND) |
| 104 #include "chrome/browser/background/background_mode_manager.h" | 106 #include "chrome/browser/background/background_mode_manager.h" |
| 105 #endif | 107 #endif |
| 106 | 108 |
| 107 #if defined(ENABLE_EXTENSIONS) | 109 #if defined(ENABLE_EXTENSIONS) |
| 108 #include "chrome/browser/accessibility/animation_policy_prefs.h" | 110 #include "chrome/browser/accessibility/animation_policy_prefs.h" |
| 109 #include "chrome/browser/apps/shortcut_manager.h" | 111 #include "chrome/browser/apps/shortcut_manager.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 287 "googlegeolocationaccess.enabled"; | 289 "googlegeolocationaccess.enabled"; |
| 288 #endif | 290 #endif |
| 289 | 291 |
| 290 // Deprecated 4/2016. | 292 // Deprecated 4/2016. |
| 291 const char kCheckDefaultBrowser[] = "browser.check_default_browser"; | 293 const char kCheckDefaultBrowser[] = "browser.check_default_browser"; |
| 292 | 294 |
| 293 // Deprecated 5/2016. | 295 // Deprecated 5/2016. |
| 294 const char kDesktopSearchRedirectionInfobarShownPref[] = | 296 const char kDesktopSearchRedirectionInfobarShownPref[] = |
| 295 "desktop_search_redirection_infobar_shown"; | 297 "desktop_search_redirection_infobar_shown"; |
| 296 | 298 |
| 299 void DeleteWebRTCIdentityStoreDBOnFileThread(base::FilePath profile_path) { | |
| 300 base::DeleteFile(profile_path.Append("WebRTCIdentityStore"), false); | |
| 301 base::DeleteFile(profile_path.Append("WebRTCIdentityStore-journal"), false); | |
| 302 } | |
| 303 | |
| 304 void DeleteWebRTCIdentityStoreDB(Profile* profile) { | |
| 305 content::BrowserThread::PostTask( | |
|
battre
2016/07/01 10:43:45
I would suggest to use PostDelayedTask with a dela
hbos_chromium
2016/07/01 12:15:35
That makes sense! Done.
| |
| 306 content::BrowserThread::IO, | |
| 307 FROM_HERE, | |
| 308 base::Bind(&DeleteWebRTCIdentityStoreDBOnFileThread, profile->GetPath())); | |
| 309 } | |
| 310 | |
| 297 } // namespace | 311 } // namespace |
| 298 | 312 |
| 299 namespace chrome { | 313 namespace chrome { |
| 300 | 314 |
| 301 void RegisterLocalState(PrefRegistrySimple* registry) { | 315 void RegisterLocalState(PrefRegistrySimple* registry) { |
| 302 // Please keep this list alphabetized. | 316 // Please keep this list alphabetized. |
| 303 AppListService::RegisterPrefs(registry); | 317 AppListService::RegisterPrefs(registry); |
| 304 browser_shutdown::RegisterPrefs(registry); | 318 browser_shutdown::RegisterPrefs(registry); |
| 305 BrowserProcessImpl::RegisterPrefs(registry); | 319 BrowserProcessImpl::RegisterPrefs(registry); |
| 306 ChromeMetricsServiceClient::RegisterPrefs(registry); | 320 ChromeMetricsServiceClient::RegisterPrefs(registry); |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 702 metrics_service | 716 metrics_service |
| 703 ? base::Time::FromTimeT(metrics_service->GetInstallDate()) | 717 ? base::Time::FromTimeT(metrics_service->GetInstallDate()) |
| 704 : base::Time::Now(); | 718 : base::Time::Now(); |
| 705 profile_prefs->SetInt64(prefs::kDefaultBrowserLastDeclined, | 719 profile_prefs->SetInt64(prefs::kDefaultBrowserLastDeclined, |
| 706 install_time.ToInternalValue()); | 720 install_time.ToInternalValue()); |
| 707 } | 721 } |
| 708 profile_prefs->ClearPref(kCheckDefaultBrowser); | 722 profile_prefs->ClearPref(kCheckDefaultBrowser); |
| 709 | 723 |
| 710 // Added 5/2016. | 724 // Added 5/2016. |
| 711 profile_prefs->ClearPref(kDesktopSearchRedirectionInfobarShownPref); | 725 profile_prefs->ClearPref(kDesktopSearchRedirectionInfobarShownPref); |
| 726 | |
| 727 // Added 7/2016. | |
| 728 DeleteWebRTCIdentityStoreDB(profile); | |
| 712 } | 729 } |
| 713 | 730 |
| 714 } // namespace chrome | 731 } // namespace chrome |
| OLD | NEW |