OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/profiles/profile_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" | 76 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" |
77 #include "chrome/common/chrome_constants.h" | 77 #include "chrome/common/chrome_constants.h" |
78 #include "chrome/common/chrome_paths_internal.h" | 78 #include "chrome/common/chrome_paths_internal.h" |
79 #include "chrome/common/chrome_switches.h" | 79 #include "chrome/common/chrome_switches.h" |
80 #include "chrome/common/chrome_version_info.h" | 80 #include "chrome/common/chrome_version_info.h" |
81 #include "chrome/common/pref_names.h" | 81 #include "chrome/common/pref_names.h" |
82 #include "chrome/common/url_constants.h" | 82 #include "chrome/common/url_constants.h" |
83 #include "chrome/grit/chromium_strings.h" | 83 #include "chrome/grit/chromium_strings.h" |
84 #include "components/bookmarks/browser/bookmark_model.h" | 84 #include "components/bookmarks/browser/bookmark_model.h" |
85 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_para
ms.h" | 85 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_para
ms.h" |
| 86 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref
s.h" |
86 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" | 87 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" |
87 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat
istics_prefs.h" | 88 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat
istics_prefs.h" |
88 #include "components/domain_reliability/monitor.h" | 89 #include "components/domain_reliability/monitor.h" |
89 #include "components/domain_reliability/service.h" | 90 #include "components/domain_reliability/service.h" |
90 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 91 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
91 #include "components/metrics/metrics_service.h" | 92 #include "components/metrics/metrics_service.h" |
92 #include "components/pref_registry/pref_registry_syncable.h" | 93 #include "components/pref_registry/pref_registry_syncable.h" |
93 #include "components/startup_metric_utils/startup_metric_utils.h" | 94 #include "components/startup_metric_utils/startup_metric_utils.h" |
94 #include "components/url_fixer/url_fixer.h" | 95 #include "components/url_fixer/url_fixer.h" |
95 #include "components/user_prefs/user_prefs.h" | 96 #include "components/user_prefs/user_prefs.h" |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 #if defined(OS_ANDROID) || defined(OS_IOS) | 658 #if defined(OS_ANDROID) || defined(OS_IOS) |
658 // On mobile we write data reduction proxy prefs directly to the pref service. | 659 // On mobile we write data reduction proxy prefs directly to the pref service. |
659 // On desktop we store data reduction proxy prefs in memory, writing to disk | 660 // On desktop we store data reduction proxy prefs in memory, writing to disk |
660 // every 60 minutes and on termination. Shutdown hooks must be added for | 661 // every 60 minutes and on termination. Shutdown hooks must be added for |
661 // Android and iOS in order for non-zero delays to be supported. | 662 // Android and iOS in order for non-zero delays to be supported. |
662 // (http://crbug.com/408264) | 663 // (http://crbug.com/408264) |
663 base::TimeDelta commit_delay = base::TimeDelta(); | 664 base::TimeDelta commit_delay = base::TimeDelta(); |
664 #else | 665 #else |
665 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); | 666 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); |
666 #endif | 667 #endif |
| 668 // TODO(bengr): Remove this in M-43. |
| 669 data_reduction_proxy::MigrateStatisticsPrefs(g_browser_process->local_state(), |
| 670 prefs_.get()); |
667 data_reduction_proxy_statistics_prefs = | 671 data_reduction_proxy_statistics_prefs = |
668 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs>( | 672 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs>( |
669 new data_reduction_proxy::DataReductionProxyStatisticsPrefs( | 673 new data_reduction_proxy::DataReductionProxyStatisticsPrefs( |
670 g_browser_process->local_state(), | 674 prefs_.get(), |
671 base::MessageLoopProxy::current(), | 675 base::MessageLoopProxy::current(), |
672 commit_delay)); | 676 commit_delay)); |
673 data_reduction_proxy_chrome_settings->SetDataReductionProxyStatisticsPrefs( | 677 data_reduction_proxy_chrome_settings->SetDataReductionProxyStatisticsPrefs( |
674 data_reduction_proxy_statistics_prefs.get()); | 678 data_reduction_proxy_statistics_prefs.get()); |
675 | 679 |
676 // Make sure we initialize the ProfileIOData after everything else has been | 680 // Make sure we initialize the ProfileIOData after everything else has been |
677 // initialized that we might be reading from the IO thread. | 681 // initialized that we might be reading from the IO thread. |
678 | 682 |
679 io_data_.Init(cookie_path, channel_id_path, cache_path, | 683 io_data_.Init(cookie_path, channel_id_path, cache_path, |
680 cache_max_size, media_cache_path, media_cache_max_size, | 684 cache_max_size, media_cache_path, media_cache_max_size, |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1382 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1379 domain_reliability::DomainReliabilityService* service = | 1383 domain_reliability::DomainReliabilityService* service = |
1380 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1384 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1381 GetForBrowserContext(this); | 1385 GetForBrowserContext(this); |
1382 if (!service) | 1386 if (!service) |
1383 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1387 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1384 | 1388 |
1385 return service->CreateMonitor( | 1389 return service->CreateMonitor( |
1386 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1390 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
1387 } | 1391 } |
OLD | NEW |