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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 #include "content/public/browser/storage_partition.h" | 101 #include "content/public/browser/storage_partition.h" |
102 #include "content/public/browser/url_data_source.h" | 102 #include "content/public/browser/url_data_source.h" |
103 #include "content/public/browser/user_metrics.h" | 103 #include "content/public/browser/user_metrics.h" |
104 #include "content/public/common/content_constants.h" | 104 #include "content/public/common/content_constants.h" |
105 #include "content/public/common/page_zoom.h" | 105 #include "content/public/common/page_zoom.h" |
106 #include "ui/base/l10n/l10n_util.h" | 106 #include "ui/base/l10n/l10n_util.h" |
107 | 107 |
108 #if defined(OS_ANDROID) | 108 #if defined(OS_ANDROID) |
109 #include "chrome/browser/media/protected_media_identifier_permission_context.h" | 109 #include "chrome/browser/media/protected_media_identifier_permission_context.h" |
110 #include "chrome/browser/media/protected_media_identifier_permission_context_fac tory.h" | 110 #include "chrome/browser/media/protected_media_identifier_permission_context_fac tory.h" |
111 #include "components/data_reduction_proxy/content/data_reduction_proxy_ui_servic e.h" | |
111 #endif | 112 #endif |
112 | 113 |
113 #if defined(OS_CHROMEOS) | 114 #if defined(OS_CHROMEOS) |
114 #include "chrome/browser/chromeos/locale_change_guard.h" | 115 #include "chrome/browser/chromeos/locale_change_guard.h" |
115 #include "chrome/browser/chromeos/preferences.h" | 116 #include "chrome/browser/chromeos/preferences.h" |
116 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 117 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
117 #include "components/user_manager/user_manager.h" | 118 #include "components/user_manager/user_manager.h" |
118 #endif | 119 #endif |
119 | 120 |
120 #if defined(ENABLE_BACKGROUND) | 121 #if defined(ENABLE_BACKGROUND) |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
633 } | 634 } |
634 | 635 |
635 InitHostZoomMap(); | 636 InitHostZoomMap(); |
636 | 637 |
637 base::Callback<void(bool)> data_reduction_proxy_unavailable; | 638 base::Callback<void(bool)> data_reduction_proxy_unavailable; |
638 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> | 639 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> |
639 data_reduction_proxy_params; | 640 data_reduction_proxy_params; |
640 scoped_ptr<DataReductionProxyChromeConfigurator> chrome_configurator; | 641 scoped_ptr<DataReductionProxyChromeConfigurator> chrome_configurator; |
641 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> | 642 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> |
642 data_reduction_proxy_statistics_prefs; | 643 data_reduction_proxy_statistics_prefs; |
644 #if defined(OS_ANDROID) | |
645 scoped_ptr<data_reduction_proxy::DataReductionProxyUIService> | |
bengr
2014/10/31 17:06:47
Move the scoped_ptr outside the "#if defined" bloc
megjablon
2014/12/11 23:32:03
Acknowledged.
| |
646 data_reduction_proxy_ui_service = | |
647 scoped_ptr<data_reduction_proxy::DataReductionProxyUIService>( | |
648 new data_reduction_proxy::DataReductionProxyUIService()); | |
649 #endif | |
643 DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings = | 650 DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings = |
644 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this); | 651 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this); |
645 data_reduction_proxy_params = | 652 data_reduction_proxy_params = |
646 data_reduction_proxy_chrome_settings->params()->Clone(); | 653 data_reduction_proxy_chrome_settings->params()->Clone(); |
647 data_reduction_proxy_unavailable = | 654 data_reduction_proxy_unavailable = |
648 base::Bind( | 655 base::Bind( |
649 &data_reduction_proxy::DataReductionProxySettings::SetUnreachable, | 656 &data_reduction_proxy::DataReductionProxySettings::SetUnreachable, |
650 base::Unretained(data_reduction_proxy_chrome_settings)); | 657 base::Unretained(data_reduction_proxy_chrome_settings)); |
651 // The configurator is used by DataReductionProxyChromeSettings and | 658 // The configurator is used by DataReductionProxyChromeSettings and |
652 // ProfileIOData. Ownership is passed to the latter via ProfileIOData::Handle, | 659 // ProfileIOData. Ownership is passed to the latter via ProfileIOData::Handle, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
686 // initialized that we might be reading from the IO thread. | 693 // initialized that we might be reading from the IO thread. |
687 | 694 |
688 io_data_.Init(cookie_path, channel_id_path, cache_path, | 695 io_data_.Init(cookie_path, channel_id_path, cache_path, |
689 cache_max_size, media_cache_path, media_cache_max_size, | 696 cache_max_size, media_cache_path, media_cache_max_size, |
690 extensions_cookie_path, GetPath(), infinite_cache_path, | 697 extensions_cookie_path, GetPath(), infinite_cache_path, |
691 predictor_, session_cookie_mode, GetSpecialStoragePolicy(), | 698 predictor_, session_cookie_mode, GetSpecialStoragePolicy(), |
692 CreateDomainReliabilityMonitor(local_state), | 699 CreateDomainReliabilityMonitor(local_state), |
693 data_reduction_proxy_unavailable, | 700 data_reduction_proxy_unavailable, |
694 chrome_configurator.Pass(), | 701 chrome_configurator.Pass(), |
695 data_reduction_proxy_params.Pass(), | 702 data_reduction_proxy_params.Pass(), |
696 data_reduction_proxy_statistics_prefs.Pass()); | 703 data_reduction_proxy_statistics_prefs.Pass(), |
704 #if defined(OS_ANDROID) | |
705 data_reduction_proxy_ui_service.Pass()); | |
706 #else | |
707 NULL); | |
708 #endif | |
709 | |
697 data_reduction_proxy_chrome_settings->InitDataReductionProxySettings( | 710 data_reduction_proxy_chrome_settings->InitDataReductionProxySettings( |
698 data_reduction_proxy_chrome_configurator, | 711 data_reduction_proxy_chrome_configurator, |
699 prefs_.get(), | 712 prefs_.get(), |
700 g_browser_process->local_state(), | 713 g_browser_process->local_state(), |
701 GetRequestContext()); | 714 GetRequestContext()); |
702 | 715 |
703 #if defined(ENABLE_PLUGINS) | 716 #if defined(ENABLE_PLUGINS) |
704 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( | 717 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( |
705 PluginPrefs::GetForProfile(this).get(), | 718 PluginPrefs::GetForProfile(this).get(), |
706 io_data_.GetResourceContextNoInit()); | 719 io_data_.GetResourceContextNoInit()); |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1388 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1401 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1389 domain_reliability::DomainReliabilityService* service = | 1402 domain_reliability::DomainReliabilityService* service = |
1390 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1403 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1391 GetForBrowserContext(this); | 1404 GetForBrowserContext(this); |
1392 if (!service) | 1405 if (!service) |
1393 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1406 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1394 | 1407 |
1395 return service->CreateMonitor( | 1408 return service->CreateMonitor( |
1396 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1409 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
1397 } | 1410 } |
OLD | NEW |