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 27 matching lines...) Expand all Loading... |
38 #include "chrome/browser/dom_distiller/lazy_dom_distiller_service.h" | 38 #include "chrome/browser/dom_distiller/lazy_dom_distiller_service.h" |
39 #include "chrome/browser/domain_reliability/service_factory.h" | 39 #include "chrome/browser/domain_reliability/service_factory.h" |
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_settings.h" |
48 #include "chrome/browser/net/ssl_config_service_manager.h" | 49 #include "chrome/browser/net/ssl_config_service_manager.h" |
49 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 50 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
50 #include "chrome/browser/plugins/plugin_prefs.h" | 51 #include "chrome/browser/plugins/plugin_prefs.h" |
51 #include "chrome/browser/policy/profile_policy_connector.h" | 52 #include "chrome/browser/policy/profile_policy_connector.h" |
52 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 53 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
53 #include "chrome/browser/prefs/browser_prefs.h" | 54 #include "chrome/browser/prefs/browser_prefs.h" |
54 #include "chrome/browser/prefs/chrome_pref_service_factory.h" | 55 #include "chrome/browser/prefs/chrome_pref_service_factory.h" |
55 #include "chrome/browser/prefs/pref_service_syncable.h" | 56 #include "chrome/browser/prefs/pref_service_syncable.h" |
56 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" | 57 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" |
57 #include "chrome/browser/prerender/prerender_manager_factory.h" | 58 #include "chrome/browser/prerender/prerender_manager_factory.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 #include "chrome/browser/media/protected_media_identifier_permission_context_fac
tory.h" | 107 #include "chrome/browser/media/protected_media_identifier_permission_context_fac
tory.h" |
107 #endif | 108 #endif |
108 | 109 |
109 #if defined(OS_CHROMEOS) | 110 #if defined(OS_CHROMEOS) |
110 #include "chrome/browser/chromeos/locale_change_guard.h" | 111 #include "chrome/browser/chromeos/locale_change_guard.h" |
111 #include "chrome/browser/chromeos/login/users/user_manager.h" | 112 #include "chrome/browser/chromeos/login/users/user_manager.h" |
112 #include "chrome/browser/chromeos/preferences.h" | 113 #include "chrome/browser/chromeos/preferences.h" |
113 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 114 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
114 #endif | 115 #endif |
115 | 116 |
| 117 #if defined(SPDY_PROXY_AUTH_ORIGIN) |
| 118 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.
h" |
| 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 #endif |
| 123 |
116 #if defined(ENABLE_CONFIGURATION_POLICY) | 124 #if defined(ENABLE_CONFIGURATION_POLICY) |
117 #include "chrome/browser/policy/schema_registry_service.h" | 125 #include "chrome/browser/policy/schema_registry_service.h" |
118 #include "chrome/browser/policy/schema_registry_service_factory.h" | 126 #include "chrome/browser/policy/schema_registry_service_factory.h" |
119 #include "components/policy/core/browser/browser_policy_connector.h" | 127 #include "components/policy/core/browser/browser_policy_connector.h" |
120 #if defined(OS_CHROMEOS) | 128 #if defined(OS_CHROMEOS) |
121 #include "chrome/browser/chromeos/login/login_utils.h" | 129 #include "chrome/browser/chromeos/login/login_utils.h" |
122 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 130 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
123 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" | 131 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" |
124 #else | 132 #else |
125 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 133 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 #endif | 611 #endif |
604 content::CookieStoreConfig::SessionCookieMode session_cookie_mode = | 612 content::CookieStoreConfig::SessionCookieMode session_cookie_mode = |
605 content::CookieStoreConfig::PERSISTANT_SESSION_COOKIES; | 613 content::CookieStoreConfig::PERSISTANT_SESSION_COOKIES; |
606 if (GetLastSessionExitType() == Profile::EXIT_CRASHED || | 614 if (GetLastSessionExitType() == Profile::EXIT_CRASHED || |
607 startup_pref_type == SessionStartupPref::LAST) { | 615 startup_pref_type == SessionStartupPref::LAST) { |
608 session_cookie_mode = content::CookieStoreConfig::RESTORED_SESSION_COOKIES; | 616 session_cookie_mode = content::CookieStoreConfig::RESTORED_SESSION_COOKIES; |
609 } | 617 } |
610 | 618 |
611 InitHostZoomMap(); | 619 InitHostZoomMap(); |
612 | 620 |
| 621 base::Callback<void(bool)> data_reduction_proxy_unavailable; |
| 622 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> |
| 623 data_reduction_proxy_params; |
| 624 #if defined(SPDY_PROXY_AUTH_ORIGIN) |
| 625 DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings = |
| 626 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this); |
| 627 data_reduction_proxy_params = |
| 628 data_reduction_proxy_chrome_settings->params()->Clone(); |
| 629 data_reduction_proxy_unavailable = |
| 630 base::Bind( |
| 631 &data_reduction_proxy::DataReductionProxySettings::SetUnreachable, |
| 632 base::Unretained(data_reduction_proxy_chrome_settings)); |
| 633 #endif |
| 634 |
613 // Make sure we initialize the ProfileIOData after everything else has been | 635 // Make sure we initialize the ProfileIOData after everything else has been |
614 // initialized that we might be reading from the IO thread. | 636 // initialized that we might be reading from the IO thread. |
615 | 637 |
616 io_data_.Init(cookie_path, channel_id_path, cache_path, | 638 io_data_.Init(cookie_path, channel_id_path, cache_path, |
617 cache_max_size, media_cache_path, media_cache_max_size, | 639 cache_max_size, media_cache_path, media_cache_max_size, |
618 extensions_cookie_path, GetPath(), infinite_cache_path, | 640 extensions_cookie_path, GetPath(), infinite_cache_path, |
619 predictor_, session_cookie_mode, GetSpecialStoragePolicy(), | 641 predictor_, session_cookie_mode, GetSpecialStoragePolicy(), |
620 CreateDomainReliabilityMonitor()); | 642 CreateDomainReliabilityMonitor(), |
| 643 data_reduction_proxy_unavailable, |
| 644 data_reduction_proxy_params.Pass()); |
| 645 |
| 646 #if defined(SPDY_PROXY_AUTH_ORIGIN) |
| 647 scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator> |
| 648 configurator(new DataReductionProxyChromeConfigurator(prefs_.get())); |
| 649 data_reduction_proxy_chrome_settings->InitDataReductionProxySettings( |
| 650 configurator.Pass(), |
| 651 prefs_.get(), |
| 652 g_browser_process->local_state(), |
| 653 GetRequestContext()); |
| 654 #endif |
621 | 655 |
622 #if defined(ENABLE_PLUGINS) | 656 #if defined(ENABLE_PLUGINS) |
623 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( | 657 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( |
624 PluginPrefs::GetForProfile(this).get(), | 658 PluginPrefs::GetForProfile(this).get(), |
625 io_data_.GetResourceContextNoInit()); | 659 io_data_.GetResourceContextNoInit()); |
626 #endif | 660 #endif |
627 | 661 |
628 // Delay README creation to not impact startup performance. | 662 // Delay README creation to not impact startup performance. |
629 BrowserThread::PostDelayedTask( | 663 BrowserThread::PostDelayedTask( |
630 BrowserThread::FILE, FROM_HERE, | 664 BrowserThread::FILE, FROM_HERE, |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1349 ProfileImpl::CreateDomainReliabilityMonitor() { | 1383 ProfileImpl::CreateDomainReliabilityMonitor() { |
1350 domain_reliability::DomainReliabilityService* service = | 1384 domain_reliability::DomainReliabilityService* service = |
1351 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1385 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1352 GetForBrowserContext(this); | 1386 GetForBrowserContext(this); |
1353 if (!service) | 1387 if (!service) |
1354 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1388 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1355 | 1389 |
1356 return service->CreateMonitor( | 1390 return service->CreateMonitor( |
1357 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1391 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
1358 } | 1392 } |
OLD | NEW |