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/content_settings/core/browser/host_content_settings_map.h" | 85 #include "components/content_settings/core/browser/host_content_settings_map.h" |
86 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf igurator.h" | |
87 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h" | 86 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h" |
88 #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" |
89 #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" |
90 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" | 89 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" |
91 #include "components/domain_reliability/monitor.h" | 90 #include "components/domain_reliability/monitor.h" |
92 #include "components/domain_reliability/service.h" | 91 #include "components/domain_reliability/service.h" |
93 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 92 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
94 #include "components/metrics/metrics_service.h" | 93 #include "components/metrics/metrics_service.h" |
95 #include "components/pref_registry/pref_registry_syncable.h" | 94 #include "components/pref_registry/pref_registry_syncable.h" |
96 #include "components/signin/core/browser/signin_manager.h" | 95 #include "components/signin/core/browser/signin_manager.h" |
97 #include "components/startup_metric_utils/startup_metric_utils.h" | 96 #include "components/startup_metric_utils/startup_metric_utils.h" |
98 #include "components/ui/zoom/zoom_event_manager.h" | 97 #include "components/ui/zoom/zoom_event_manager.h" |
99 #include "components/url_fixer/url_fixer.h" | 98 #include "components/url_fixer/url_fixer.h" |
100 #include "components/user_prefs/user_prefs.h" | 99 #include "components/user_prefs/user_prefs.h" |
101 #include "content/public/browser/browser_thread.h" | 100 #include "content/public/browser/browser_thread.h" |
102 #include "content/public/browser/dom_storage_context.h" | 101 #include "content/public/browser/dom_storage_context.h" |
103 #include "content/public/browser/notification_service.h" | 102 #include "content/public/browser/notification_service.h" |
104 #include "content/public/browser/render_process_host.h" | 103 #include "content/public/browser/render_process_host.h" |
105 #include "content/public/browser/storage_partition.h" | 104 #include "content/public/browser/storage_partition.h" |
106 #include "content/public/browser/url_data_source.h" | 105 #include "content/public/browser/url_data_source.h" |
107 #include "content/public/browser/user_metrics.h" | 106 #include "content/public/browser/user_metrics.h" |
108 #include "content/public/common/content_constants.h" | 107 #include "content/public/common/content_constants.h" |
109 #include "content/public/common/page_zoom.h" | 108 #include "content/public/common/page_zoom.h" |
110 #include "ui/base/l10n/l10n_util.h" | 109 #include "ui/base/l10n/l10n_util.h" |
111 | 110 |
112 #if defined(OS_ANDROID) | 111 #if defined(OS_ANDROID) |
113 #include "chrome/browser/media/protected_media_identifier_permission_context.h" | 112 #include "chrome/browser/media/protected_media_identifier_permission_context.h" |
114 #include "chrome/browser/media/protected_media_identifier_permission_context_fac tory.h" | 113 #include "chrome/browser/media/protected_media_identifier_permission_context_fac tory.h" |
114 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_u i_service.h" | |
115 #endif | 115 #endif |
116 | 116 |
117 #if defined(OS_CHROMEOS) | 117 #if defined(OS_CHROMEOS) |
118 #include "chrome/browser/chromeos/locale_change_guard.h" | 118 #include "chrome/browser/chromeos/locale_change_guard.h" |
119 #include "chrome/browser/chromeos/preferences.h" | 119 #include "chrome/browser/chromeos/preferences.h" |
120 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 120 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
121 #include "components/user_manager/user_manager.h" | 121 #include "components/user_manager/user_manager.h" |
122 #endif | 122 #endif |
123 | 123 |
124 #if defined(ENABLE_BACKGROUND) | 124 #if defined(ENABLE_BACKGROUND) |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
641 | 641 |
642 ChromeNetLog* const net_log = g_browser_process->io_thread()->net_log(); | 642 ChromeNetLog* const net_log = g_browser_process->io_thread()->net_log(); |
643 | 643 |
644 base::Callback<void(bool)> data_reduction_proxy_unavailable; | 644 base::Callback<void(bool)> data_reduction_proxy_unavailable; |
645 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> | 645 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> |
646 data_reduction_proxy_params; | 646 data_reduction_proxy_params; |
647 scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator> configurator; | 647 scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator> configurator; |
648 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> | 648 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> |
649 data_reduction_proxy_statistics_prefs; | 649 data_reduction_proxy_statistics_prefs; |
650 scoped_ptr<data_reduction_proxy::DataReductionProxyEventStore> event_store; | 650 scoped_ptr<data_reduction_proxy::DataReductionProxyEventStore> event_store; |
651 #if defined(OS_ANDROID) | |
mmenke
2015/01/09 15:25:13
Also, why are we creating this on the UI thread in
mmenke
2015/01/09 15:25:13
Why is this only for Android? Why are we passing
megjablon
2015/01/12 22:01:58
Ya, it makes more sense where we call "set_proxy_c
megjablon
2015/01/12 22:01:58
Sent an email with why this is Android only.
mmenke
2015/01/12 22:06:07
Sorry, I meant why is this not on desktop (Where,
| |
652 scoped_ptr<data_reduction_proxy::DataReductionProxyUIService> | |
653 data_reduction_proxy_ui_service( | |
654 new data_reduction_proxy::DataReductionProxyUIService()); | |
655 #endif | |
651 DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings = | 656 DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings = |
652 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this); | 657 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this); |
653 data_reduction_proxy_params = | 658 data_reduction_proxy_params = |
654 data_reduction_proxy_chrome_settings->params()->Clone(); | 659 data_reduction_proxy_chrome_settings->params()->Clone(); |
655 data_reduction_proxy_unavailable = | 660 data_reduction_proxy_unavailable = |
656 base::Bind( | 661 base::Bind( |
657 &data_reduction_proxy::DataReductionProxySettings::SetUnreachable, | 662 &data_reduction_proxy::DataReductionProxySettings::SetUnreachable, |
658 base::Unretained(data_reduction_proxy_chrome_settings)); | 663 base::Unretained(data_reduction_proxy_chrome_settings)); |
659 // The event_store is used by DataReductionProxyChromeSettings, configurator, | 664 // The event_store is used by DataReductionProxyChromeSettings, configurator, |
660 // and ProfileIOData. Ownership is passed to the latter via | 665 // and ProfileIOData. Ownership is passed to the latter via |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
707 | 712 |
708 io_data_.Init(cookie_path, channel_id_path, cache_path, | 713 io_data_.Init(cookie_path, channel_id_path, cache_path, |
709 cache_max_size, media_cache_path, media_cache_max_size, | 714 cache_max_size, media_cache_path, media_cache_max_size, |
710 extensions_cookie_path, GetPath(), infinite_cache_path, | 715 extensions_cookie_path, GetPath(), infinite_cache_path, |
711 predictor_, session_cookie_mode, GetSpecialStoragePolicy(), | 716 predictor_, session_cookie_mode, GetSpecialStoragePolicy(), |
712 CreateDomainReliabilityMonitor(local_state), | 717 CreateDomainReliabilityMonitor(local_state), |
713 data_reduction_proxy_unavailable, | 718 data_reduction_proxy_unavailable, |
714 configurator.Pass(), | 719 configurator.Pass(), |
715 data_reduction_proxy_params.Pass(), | 720 data_reduction_proxy_params.Pass(), |
716 data_reduction_proxy_statistics_prefs.Pass(), | 721 data_reduction_proxy_statistics_prefs.Pass(), |
722 #if defined(OS_ANDROID) | |
723 data_reduction_proxy_ui_service.Pass(), | |
724 #endif | |
717 event_store.Pass()); | 725 event_store.Pass()); |
718 data_reduction_proxy_chrome_settings->InitDataReductionProxySettings( | 726 data_reduction_proxy_chrome_settings->InitDataReductionProxySettings( |
719 data_reduction_proxy_configurator, | 727 data_reduction_proxy_configurator, |
720 prefs_.get(), | 728 prefs_.get(), |
721 g_browser_process->local_state(), | 729 g_browser_process->local_state(), |
722 GetRequestContext(), | 730 GetRequestContext(), |
723 net_log, | 731 net_log, |
724 data_reduction_proxy_event_store); | 732 data_reduction_proxy_event_store); |
725 | 733 |
726 #if defined(ENABLE_PLUGINS) | 734 #if defined(ENABLE_PLUGINS) |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1418 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1426 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1419 domain_reliability::DomainReliabilityService* service = | 1427 domain_reliability::DomainReliabilityService* service = |
1420 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1428 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1421 GetForBrowserContext(this); | 1429 GetForBrowserContext(this); |
1422 if (!service) | 1430 if (!service) |
1423 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1431 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1424 | 1432 |
1425 return service->CreateMonitor( | 1433 return service->CreateMonitor( |
1426 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1434 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
1427 } | 1435 } |
OLD | NEW |