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_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 #include "net/http/http_util.h" | 63 #include "net/http/http_util.h" |
64 #include "net/proxy/proxy_config_service_fixed.h" | 64 #include "net/proxy/proxy_config_service_fixed.h" |
65 #include "net/proxy/proxy_script_fetcher_impl.h" | 65 #include "net/proxy/proxy_script_fetcher_impl.h" |
66 #include "net/proxy/proxy_service.h" | 66 #include "net/proxy/proxy_service.h" |
67 #include "net/url_request/data_protocol_handler.h" | 67 #include "net/url_request/data_protocol_handler.h" |
68 #include "net/url_request/file_protocol_handler.h" | 68 #include "net/url_request/file_protocol_handler.h" |
69 #include "net/url_request/ftp_protocol_handler.h" | 69 #include "net/url_request/ftp_protocol_handler.h" |
70 #include "net/url_request/url_request.h" | 70 #include "net/url_request/url_request.h" |
71 #include "net/url_request/url_request_job_factory_impl.h" | 71 #include "net/url_request/url_request_job_factory_impl.h" |
72 | 72 |
| 73 #if defined(ENABLE_MANAGED_USERS) |
| 74 #include "chrome/browser/managed_mode/managed_mode_url_filter.h" |
| 75 #include "chrome/browser/managed_mode/managed_user_service.h" |
| 76 #include "chrome/browser/managed_mode/managed_user_service_factory.h" |
| 77 #endif |
| 78 |
73 #if defined(OS_CHROMEOS) | 79 #if defined(OS_CHROMEOS) |
74 #include "chrome/browser/chromeos/drive/drive_protocol_handler.h" | 80 #include "chrome/browser/chromeos/drive/drive_protocol_handler.h" |
75 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 81 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
76 #include "chrome/browser/chromeos/settings/cros_settings.h" | 82 #include "chrome/browser/chromeos/settings/cros_settings.h" |
77 #include "chrome/browser/chromeos/settings/cros_settings_names.h" | 83 #include "chrome/browser/chromeos/settings/cros_settings_names.h" |
78 #endif // defined(OS_CHROMEOS) | 84 #endif // defined(OS_CHROMEOS) |
79 | 85 |
80 using content::BrowserContext; | 86 using content::BrowserContext; |
81 using content::BrowserThread; | 87 using content::BrowserThread; |
82 using content::ResourceContext; | 88 using content::ResourceContext; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // method, so we create the url job factory here, then save it for | 181 // method, so we create the url job factory here, then save it for |
176 // later delivery to the job factory in LazyInitialize. | 182 // later delivery to the job factory in LazyInitialize. |
177 params->protocol_handler_interceptor = | 183 params->protocol_handler_interceptor = |
178 protocol_handler_registry->CreateJobInterceptorFactory(); | 184 protocol_handler_registry->CreateJobInterceptorFactory(); |
179 | 185 |
180 ChromeProxyConfigService* proxy_config_service = | 186 ChromeProxyConfigService* proxy_config_service = |
181 ProxyServiceFactory::CreateProxyConfigService(); | 187 ProxyServiceFactory::CreateProxyConfigService(); |
182 params->proxy_config_service.reset(proxy_config_service); | 188 params->proxy_config_service.reset(proxy_config_service); |
183 profile->GetProxyConfigTracker()->SetChromeProxyConfigService( | 189 profile->GetProxyConfigTracker()->SetChromeProxyConfigService( |
184 proxy_config_service); | 190 proxy_config_service); |
| 191 #if defined(ENABLE_MANAGED_USERS) |
| 192 ManagedUserService* managed_user_service = |
| 193 ManagedUserServiceFactory::GetForProfile(profile); |
| 194 params->managed_mode_url_filter = |
| 195 managed_user_service->GetURLFilterForIOThread(); |
| 196 #endif |
| 197 |
185 params->profile = profile; | 198 params->profile = profile; |
186 profile_params_.reset(params.release()); | 199 profile_params_.reset(params.release()); |
187 | 200 |
188 ChromeNetworkDelegate::InitializePrefsOnUIThread( | 201 ChromeNetworkDelegate::InitializePrefsOnUIThread( |
189 &enable_referrers_, | 202 &enable_referrers_, |
190 &enable_do_not_track_, | 203 &enable_do_not_track_, |
191 &force_safesearch_, | 204 &force_safesearch_, |
192 pref_service); | 205 pref_service); |
193 | 206 |
194 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy = | 207 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy = |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 extension_info_map_ = profile_params_->extension_info_map; | 596 extension_info_map_ = profile_params_->extension_info_map; |
584 | 597 |
585 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); | 598 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); |
586 resource_context_->request_context_ = main_request_context_.get(); | 599 resource_context_->request_context_ = main_request_context_.get(); |
587 | 600 |
588 if (profile_params_->resource_prefetch_predictor_observer_.get()) { | 601 if (profile_params_->resource_prefetch_predictor_observer_.get()) { |
589 resource_prefetch_predictor_observer_.reset( | 602 resource_prefetch_predictor_observer_.reset( |
590 profile_params_->resource_prefetch_predictor_observer_.release()); | 603 profile_params_->resource_prefetch_predictor_observer_.release()); |
591 } | 604 } |
592 | 605 |
| 606 #if defined(ENABLE_MANAGED_USERS) |
| 607 managed_mode_url_filter_ = profile_params_->managed_mode_url_filter; |
| 608 #endif |
| 609 |
593 LazyInitializeInternal(profile_params_.get()); | 610 LazyInitializeInternal(profile_params_.get()); |
594 | 611 |
595 profile_params_.reset(); | 612 profile_params_.reset(); |
596 initialized_ = true; | 613 initialized_ = true; |
597 } | 614 } |
598 | 615 |
599 void ProfileIOData::ApplyProfileParamsToContext( | 616 void ProfileIOData::ApplyProfileParamsToContext( |
600 ChromeURLRequestContext* context) const { | 617 ChromeURLRequestContext* context) const { |
601 context->set_http_user_agent_settings( | 618 context->set_http_user_agent_settings( |
602 chrome_http_user_agent_settings_.get()); | 619 chrome_http_user_agent_settings_.get()); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 void ProfileIOData::SetCookieSettingsForTesting( | 750 void ProfileIOData::SetCookieSettingsForTesting( |
734 CookieSettings* cookie_settings) { | 751 CookieSettings* cookie_settings) { |
735 DCHECK(!cookie_settings_.get()); | 752 DCHECK(!cookie_settings_.get()); |
736 cookie_settings_ = cookie_settings; | 753 cookie_settings_ = cookie_settings; |
737 } | 754 } |
738 | 755 |
739 void ProfileIOData::set_signin_names_for_testing( | 756 void ProfileIOData::set_signin_names_for_testing( |
740 SigninNamesOnIOThread* signin_names) { | 757 SigninNamesOnIOThread* signin_names) { |
741 signin_names_.reset(signin_names); | 758 signin_names_.reset(signin_names); |
742 } | 759 } |
OLD | NEW |