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 29 matching lines...) Expand all Loading... |
40 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 40 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
41 #include "chrome/browser/download/download_service.h" | 41 #include "chrome/browser/download/download_service.h" |
42 #include "chrome/browser/download/download_service_factory.h" | 42 #include "chrome/browser/download/download_service_factory.h" |
43 #include "chrome/browser/history/top_sites.h" | 43 #include "chrome/browser/history/top_sites.h" |
44 #include "chrome/browser/net/net_pref_observer.h" | 44 #include "chrome/browser/net/net_pref_observer.h" |
45 #include "chrome/browser/net/predictor.h" | 45 #include "chrome/browser/net/predictor.h" |
46 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 46 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
47 #include "chrome/browser/net/proxy_service_factory.h" | 47 #include "chrome/browser/net/proxy_service_factory.h" |
48 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.
h" | 48 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.
h" |
49 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 49 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
| 50 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" |
50 #include "chrome/browser/net/ssl_config_service_manager.h" | 51 #include "chrome/browser/net/ssl_config_service_manager.h" |
51 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 52 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
52 #include "chrome/browser/plugins/plugin_prefs.h" | 53 #include "chrome/browser/plugins/plugin_prefs.h" |
53 #include "chrome/browser/policy/profile_policy_connector.h" | 54 #include "chrome/browser/policy/profile_policy_connector.h" |
54 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 55 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
55 #include "chrome/browser/prefs/browser_prefs.h" | 56 #include "chrome/browser/prefs/browser_prefs.h" |
56 #include "chrome/browser/prefs/chrome_pref_service_factory.h" | 57 #include "chrome/browser/prefs/chrome_pref_service_factory.h" |
57 #include "chrome/browser/prefs/pref_service_syncable.h" | 58 #include "chrome/browser/prefs/pref_service_syncable.h" |
58 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" | 59 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" |
59 #include "chrome/browser/prerender/prerender_manager_factory.h" | 60 #include "chrome/browser/prerender/prerender_manager_factory.h" |
(...skipping 14 matching lines...) Expand all Loading... |
74 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" | 75 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" |
75 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 76 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
76 #include "chrome/common/chrome_constants.h" | 77 #include "chrome/common/chrome_constants.h" |
77 #include "chrome/common/chrome_paths_internal.h" | 78 #include "chrome/common/chrome_paths_internal.h" |
78 #include "chrome/common/chrome_switches.h" | 79 #include "chrome/common/chrome_switches.h" |
79 #include "chrome/common/chrome_version_info.h" | 80 #include "chrome/common/chrome_version_info.h" |
80 #include "chrome/common/pref_names.h" | 81 #include "chrome/common/pref_names.h" |
81 #include "chrome/common/url_constants.h" | 82 #include "chrome/common/url_constants.h" |
82 #include "chrome/grit/chromium_strings.h" | 83 #include "chrome/grit/chromium_strings.h" |
83 #include "components/bookmarks/browser/bookmark_model.h" | 84 #include "components/bookmarks/browser/bookmark_model.h" |
| 85 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" |
| 86 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" |
| 87 #include "components/data_reduction_proxy/browser/data_reduction_proxy_statistic
s_prefs.h" |
84 #include "components/dom_distiller/content/dom_distiller_viewer_source.h" | 88 #include "components/dom_distiller/content/dom_distiller_viewer_source.h" |
85 #include "components/dom_distiller/core/url_constants.h" | 89 #include "components/dom_distiller/core/url_constants.h" |
86 #include "components/domain_reliability/monitor.h" | 90 #include "components/domain_reliability/monitor.h" |
87 #include "components/domain_reliability/service.h" | 91 #include "components/domain_reliability/service.h" |
88 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 92 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
89 #include "components/metrics/metrics_service.h" | 93 #include "components/metrics/metrics_service.h" |
90 #include "components/pref_registry/pref_registry_syncable.h" | 94 #include "components/pref_registry/pref_registry_syncable.h" |
91 #include "components/startup_metric_utils/startup_metric_utils.h" | 95 #include "components/startup_metric_utils/startup_metric_utils.h" |
92 #include "components/url_fixer/url_fixer.h" | 96 #include "components/url_fixer/url_fixer.h" |
93 #include "components/user_prefs/user_prefs.h" | 97 #include "components/user_prefs/user_prefs.h" |
(...skipping 14 matching lines...) Expand all Loading... |
108 #include "chrome/browser/media/protected_media_identifier_permission_context_fac
tory.h" | 112 #include "chrome/browser/media/protected_media_identifier_permission_context_fac
tory.h" |
109 #endif | 113 #endif |
110 | 114 |
111 #if defined(OS_CHROMEOS) | 115 #if defined(OS_CHROMEOS) |
112 #include "chrome/browser/chromeos/locale_change_guard.h" | 116 #include "chrome/browser/chromeos/locale_change_guard.h" |
113 #include "chrome/browser/chromeos/preferences.h" | 117 #include "chrome/browser/chromeos/preferences.h" |
114 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 118 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
115 #include "components/user_manager/user_manager.h" | 119 #include "components/user_manager/user_manager.h" |
116 #endif | 120 #endif |
117 | 121 |
118 #if defined(SPDY_PROXY_AUTH_ORIGIN) | |
119 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" | |
120 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" | |
121 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" | |
122 #include "components/data_reduction_proxy/browser/data_reduction_proxy_statistic
s_prefs.h" | |
123 #endif | |
124 | |
125 #if defined(ENABLE_CONFIGURATION_POLICY) | 122 #if defined(ENABLE_CONFIGURATION_POLICY) |
126 #include "chrome/browser/policy/schema_registry_service.h" | 123 #include "chrome/browser/policy/schema_registry_service.h" |
127 #include "chrome/browser/policy/schema_registry_service_factory.h" | 124 #include "chrome/browser/policy/schema_registry_service_factory.h" |
128 #include "components/policy/core/browser/browser_policy_connector.h" | 125 #include "components/policy/core/browser/browser_policy_connector.h" |
129 #if defined(OS_CHROMEOS) | 126 #if defined(OS_CHROMEOS) |
130 #include "chrome/browser/chromeos/login/login_utils.h" | 127 #include "chrome/browser/chromeos/login/login_utils.h" |
131 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 128 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
132 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" | 129 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" |
133 #else | 130 #else |
134 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 131 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 } | 643 } |
647 | 644 |
648 InitHostZoomMap(); | 645 InitHostZoomMap(); |
649 | 646 |
650 base::Callback<void(bool)> data_reduction_proxy_unavailable; | 647 base::Callback<void(bool)> data_reduction_proxy_unavailable; |
651 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> | 648 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> |
652 data_reduction_proxy_params; | 649 data_reduction_proxy_params; |
653 scoped_ptr<DataReductionProxyChromeConfigurator> chrome_configurator; | 650 scoped_ptr<DataReductionProxyChromeConfigurator> chrome_configurator; |
654 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> | 651 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> |
655 data_reduction_proxy_statistics_prefs; | 652 data_reduction_proxy_statistics_prefs; |
656 #if defined(SPDY_PROXY_AUTH_ORIGIN) | |
657 DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings = | 653 DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings = |
658 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this); | 654 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this); |
659 data_reduction_proxy_params = | 655 data_reduction_proxy_params = |
660 data_reduction_proxy_chrome_settings->params()->Clone(); | 656 data_reduction_proxy_chrome_settings->params()->Clone(); |
661 data_reduction_proxy_unavailable = | 657 data_reduction_proxy_unavailable = |
662 base::Bind( | 658 base::Bind( |
663 &data_reduction_proxy::DataReductionProxySettings::SetUnreachable, | 659 &data_reduction_proxy::DataReductionProxySettings::SetUnreachable, |
664 base::Unretained(data_reduction_proxy_chrome_settings)); | 660 base::Unretained(data_reduction_proxy_chrome_settings)); |
665 // The configurator is used by DataReductionProxyChromeSettings and | 661 // The configurator is used by DataReductionProxyChromeSettings and |
666 // ProfileIOData. Ownership is passed to the latter via ProfileIOData::Handle, | 662 // ProfileIOData. Ownership is passed to the latter via ProfileIOData::Handle, |
(...skipping 18 matching lines...) Expand all Loading... |
685 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); | 681 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); |
686 #endif | 682 #endif |
687 data_reduction_proxy_statistics_prefs = | 683 data_reduction_proxy_statistics_prefs = |
688 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs>( | 684 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs>( |
689 new data_reduction_proxy::DataReductionProxyStatisticsPrefs( | 685 new data_reduction_proxy::DataReductionProxyStatisticsPrefs( |
690 g_browser_process->local_state(), | 686 g_browser_process->local_state(), |
691 base::MessageLoopProxy::current(), | 687 base::MessageLoopProxy::current(), |
692 commit_delay)); | 688 commit_delay)); |
693 data_reduction_proxy_chrome_settings->SetDataReductionProxyStatisticsPrefs( | 689 data_reduction_proxy_chrome_settings->SetDataReductionProxyStatisticsPrefs( |
694 data_reduction_proxy_statistics_prefs.get()); | 690 data_reduction_proxy_statistics_prefs.get()); |
695 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) | |
696 | 691 |
697 // Make sure we initialize the ProfileIOData after everything else has been | 692 // Make sure we initialize the ProfileIOData after everything else has been |
698 // initialized that we might be reading from the IO thread. | 693 // initialized that we might be reading from the IO thread. |
699 | 694 |
700 io_data_.Init(cookie_path, channel_id_path, cache_path, | 695 io_data_.Init(cookie_path, channel_id_path, cache_path, |
701 cache_max_size, media_cache_path, media_cache_max_size, | 696 cache_max_size, media_cache_path, media_cache_max_size, |
702 extensions_cookie_path, GetPath(), infinite_cache_path, | 697 extensions_cookie_path, GetPath(), infinite_cache_path, |
703 predictor_, session_cookie_mode, GetSpecialStoragePolicy(), | 698 predictor_, session_cookie_mode, GetSpecialStoragePolicy(), |
704 CreateDomainReliabilityMonitor(local_state), | 699 CreateDomainReliabilityMonitor(local_state), |
705 data_reduction_proxy_unavailable, | 700 data_reduction_proxy_unavailable, |
706 chrome_configurator.Pass(), | 701 chrome_configurator.Pass(), |
707 data_reduction_proxy_params.Pass(), | 702 data_reduction_proxy_params.Pass(), |
708 data_reduction_proxy_statistics_prefs.Pass()); | 703 data_reduction_proxy_statistics_prefs.Pass()); |
709 | |
710 #if defined(SPDY_PROXY_AUTH_ORIGIN) | |
711 data_reduction_proxy_chrome_settings->InitDataReductionProxySettings( | 704 data_reduction_proxy_chrome_settings->InitDataReductionProxySettings( |
712 data_reduction_proxy_chrome_configurator, | 705 data_reduction_proxy_chrome_configurator, |
713 prefs_.get(), | 706 prefs_.get(), |
714 g_browser_process->local_state(), | 707 g_browser_process->local_state(), |
715 GetRequestContext()); | 708 GetRequestContext()); |
716 #endif | |
717 | 709 |
718 #if defined(ENABLE_PLUGINS) | 710 #if defined(ENABLE_PLUGINS) |
719 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( | 711 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( |
720 PluginPrefs::GetForProfile(this).get(), | 712 PluginPrefs::GetForProfile(this).get(), |
721 io_data_.GetResourceContextNoInit()); | 713 io_data_.GetResourceContextNoInit()); |
722 #endif | 714 #endif |
723 | 715 |
724 // Delay README creation to not impact startup performance. | 716 // Delay README creation to not impact startup performance. |
725 BrowserThread::PostDelayedTask( | 717 BrowserThread::PostDelayedTask( |
726 BrowserThread::FILE, FROM_HERE, | 718 BrowserThread::FILE, FROM_HERE, |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1456 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1448 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1457 GetForBrowserContext(this); | 1449 GetForBrowserContext(this); |
1458 if (!service) | 1450 if (!service) |
1459 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1451 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1460 | 1452 |
1461 return service->CreateMonitor( | 1453 return service->CreateMonitor( |
1462 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 1454 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
1463 local_state, | 1455 local_state, |
1464 prefs::kMetricsReportingEnabled); | 1456 prefs::kMetricsReportingEnabled); |
1465 } | 1457 } |
OLD | NEW |