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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 #include "content/public/browser/storage_partition.h" | 105 #include "content/public/browser/storage_partition.h" |
106 #include "content/public/browser/url_data_source.h" | 106 #include "content/public/browser/url_data_source.h" |
107 #include "content/public/browser/user_metrics.h" | 107 #include "content/public/browser/user_metrics.h" |
108 #include "content/public/common/content_constants.h" | 108 #include "content/public/common/content_constants.h" |
109 #include "content/public/common/page_zoom.h" | 109 #include "content/public/common/page_zoom.h" |
110 #include "ui/base/l10n/l10n_util.h" | 110 #include "ui/base/l10n/l10n_util.h" |
111 | 111 |
112 #if defined(OS_ANDROID) | 112 #if defined(OS_ANDROID) |
113 #include "chrome/browser/media/protected_media_identifier_permission_context.h" | 113 #include "chrome/browser/media/protected_media_identifier_permission_context.h" |
114 #include "chrome/browser/media/protected_media_identifier_permission_context_fac tory.h" | 114 #include "chrome/browser/media/protected_media_identifier_permission_context_fac tory.h" |
115 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_u i_service.h" | |
bengr
2014/12/17 00:30:19
Include unconditionally.
megjablon
2014/12/23 02:18:02
We decided not to have a base class as discussed o
| |
115 #endif | 116 #endif |
116 | 117 |
117 #if defined(OS_CHROMEOS) | 118 #if defined(OS_CHROMEOS) |
118 #include "chrome/browser/chromeos/locale_change_guard.h" | 119 #include "chrome/browser/chromeos/locale_change_guard.h" |
119 #include "chrome/browser/chromeos/preferences.h" | 120 #include "chrome/browser/chromeos/preferences.h" |
120 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 121 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
121 #include "components/user_manager/user_manager.h" | 122 #include "components/user_manager/user_manager.h" |
122 #endif | 123 #endif |
123 | 124 |
124 #if defined(ENABLE_BACKGROUND) | 125 #if defined(ENABLE_BACKGROUND) |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
639 | 640 |
640 ChromeNetLog* const net_log = g_browser_process->io_thread()->net_log(); | 641 ChromeNetLog* const net_log = g_browser_process->io_thread()->net_log(); |
641 | 642 |
642 base::Callback<void(bool)> data_reduction_proxy_unavailable; | 643 base::Callback<void(bool)> data_reduction_proxy_unavailable; |
643 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> | 644 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> |
644 data_reduction_proxy_params; | 645 data_reduction_proxy_params; |
645 scoped_ptr<DataReductionProxyChromeConfigurator> chrome_configurator; | 646 scoped_ptr<DataReductionProxyChromeConfigurator> chrome_configurator; |
646 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> | 647 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> |
647 data_reduction_proxy_statistics_prefs; | 648 data_reduction_proxy_statistics_prefs; |
648 scoped_ptr<data_reduction_proxy::DataReductionProxyEventStore> event_store; | 649 scoped_ptr<data_reduction_proxy::DataReductionProxyEventStore> event_store; |
650 #if defined(OS_ANDROID) | |
651 scoped_ptr<data_reduction_proxy::DataReductionProxyUIService> | |
652 data_reduction_proxy_ui_service( | |
bengr
2014/12/17 00:30:19
Declare for all platforms and instantiate only if
megjablon
2014/12/23 02:18:03
We decided not to have a base class as discussed o
| |
653 new data_reduction_proxy::DataReductionProxyUIService()); | |
654 #endif | |
649 DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings = | 655 DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings = |
650 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this); | 656 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this); |
651 data_reduction_proxy_params = | 657 data_reduction_proxy_params = |
652 data_reduction_proxy_chrome_settings->params()->Clone(); | 658 data_reduction_proxy_chrome_settings->params()->Clone(); |
653 data_reduction_proxy_unavailable = | 659 data_reduction_proxy_unavailable = |
654 base::Bind( | 660 base::Bind( |
655 &data_reduction_proxy::DataReductionProxySettings::SetUnreachable, | 661 &data_reduction_proxy::DataReductionProxySettings::SetUnreachable, |
656 base::Unretained(data_reduction_proxy_chrome_settings)); | 662 base::Unretained(data_reduction_proxy_chrome_settings)); |
657 // The event_store is used by DataReductionProxyChromeSettings, configurator, | 663 // The event_store is used by DataReductionProxyChromeSettings, configurator, |
658 // and ProfileIOData. Ownership is passed to the latter via | 664 // and ProfileIOData. Ownership is passed to the latter via |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
706 | 712 |
707 io_data_.Init(cookie_path, channel_id_path, cache_path, | 713 io_data_.Init(cookie_path, channel_id_path, cache_path, |
708 cache_max_size, media_cache_path, media_cache_max_size, | 714 cache_max_size, media_cache_path, media_cache_max_size, |
709 extensions_cookie_path, GetPath(), infinite_cache_path, | 715 extensions_cookie_path, GetPath(), infinite_cache_path, |
710 predictor_, session_cookie_mode, GetSpecialStoragePolicy(), | 716 predictor_, session_cookie_mode, GetSpecialStoragePolicy(), |
711 CreateDomainReliabilityMonitor(local_state), | 717 CreateDomainReliabilityMonitor(local_state), |
712 data_reduction_proxy_unavailable, | 718 data_reduction_proxy_unavailable, |
713 chrome_configurator.Pass(), | 719 chrome_configurator.Pass(), |
714 data_reduction_proxy_params.Pass(), | 720 data_reduction_proxy_params.Pass(), |
715 data_reduction_proxy_statistics_prefs.Pass(), | 721 data_reduction_proxy_statistics_prefs.Pass(), |
722 #if defined(OS_ANDROID) | |
bengr
2014/12/17 00:30:19
Instead of changing the prototype for Android, pas
megjablon
2014/12/23 02:18:02
We decided not to have a base class as discussed o
| |
723 data_reduction_proxy_ui_service.Pass(), | |
724 #endif | |
716 event_store.Pass()); | 725 event_store.Pass()); |
726 | |
717 data_reduction_proxy_chrome_settings->InitDataReductionProxySettings( | 727 data_reduction_proxy_chrome_settings->InitDataReductionProxySettings( |
718 data_reduction_proxy_chrome_configurator, | 728 data_reduction_proxy_chrome_configurator, |
719 prefs_.get(), | 729 prefs_.get(), |
720 g_browser_process->local_state(), | 730 g_browser_process->local_state(), |
721 GetRequestContext(), | 731 GetRequestContext(), |
722 net_log, | 732 net_log, |
723 data_reduction_proxy_event_store); | 733 data_reduction_proxy_event_store); |
724 | 734 |
725 #if defined(ENABLE_PLUGINS) | 735 #if defined(ENABLE_PLUGINS) |
726 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( | 736 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1416 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1426 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1417 domain_reliability::DomainReliabilityService* service = | 1427 domain_reliability::DomainReliabilityService* service = |
1418 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1428 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1419 GetForBrowserContext(this); | 1429 GetForBrowserContext(this); |
1420 if (!service) | 1430 if (!service) |
1421 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1431 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1422 | 1432 |
1423 return service->CreateMonitor( | 1433 return service->CreateMonitor( |
1424 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1434 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
1425 } | 1435 } |
OLD | NEW |