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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); | 216 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); |
217 | 217 |
218 ChromeProxyConfigService* proxy_config_service = | 218 ChromeProxyConfigService* proxy_config_service = |
219 ProxyServiceFactory::CreateProxyConfigService(true); | 219 ProxyServiceFactory::CreateProxyConfigService(true); |
220 params->proxy_config_service.reset(proxy_config_service); | 220 params->proxy_config_service.reset(proxy_config_service); |
221 profile->GetProxyConfigTracker()->SetChromeProxyConfigService( | 221 profile->GetProxyConfigTracker()->SetChromeProxyConfigService( |
222 proxy_config_service); | 222 proxy_config_service); |
223 params->profile = profile; | 223 params->profile = profile; |
224 profile_params_.reset(params.release()); | 224 profile_params_.reset(params.release()); |
| 225 #if defined(ENABLE_PRINTING) |
| 226 printing_enabled_.Init(prefs::kPrintingEnabled, pref_service, NULL); |
| 227 printing_enabled_.MoveToThread(BrowserThread::IO); |
| 228 #endif |
225 | 229 |
226 // The URLBlacklistManager has to be created on the UI thread to register | 230 // The URLBlacklistManager has to be created on the UI thread to register |
227 // observers of |pref_service|, and it also has to clean up on | 231 // observers of |pref_service|, and it also has to clean up on |
228 // ShutdownOnUIThread to release these observers on the right thread. | 232 // ShutdownOnUIThread to release these observers on the right thread. |
229 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up, | 233 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up, |
230 // in particular when this ProfileIOData isn't |initialized_| during deletion. | 234 // in particular when this ProfileIOData isn't |initialized_| during deletion. |
231 #if defined(ENABLE_CONFIGURATION_POLICY) | 235 #if defined(ENABLE_CONFIGURATION_POLICY) |
232 url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service)); | 236 url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service)); |
233 #endif | 237 #endif |
234 | 238 |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 #endif // defined(OS_CHROMEOS) | 586 #endif // defined(OS_CHROMEOS) |
583 } | 587 } |
584 | 588 |
585 void ProfileIOData::ShutdownOnUIThread() { | 589 void ProfileIOData::ShutdownOnUIThread() { |
586 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 590 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
587 enable_referrers_.Destroy(); | 591 enable_referrers_.Destroy(); |
588 #if !defined(OS_CHROMEOS) | 592 #if !defined(OS_CHROMEOS) |
589 enable_metrics_.Destroy(); | 593 enable_metrics_.Destroy(); |
590 #endif | 594 #endif |
591 safe_browsing_enabled_.Destroy(); | 595 safe_browsing_enabled_.Destroy(); |
| 596 printing_enabled_.Destroy(); |
592 session_startup_pref_.Destroy(); | 597 session_startup_pref_.Destroy(); |
593 #if defined(ENABLE_CONFIGURATION_POLICY) | 598 #if defined(ENABLE_CONFIGURATION_POLICY) |
594 if (url_blacklist_manager_.get()) | 599 if (url_blacklist_manager_.get()) |
595 url_blacklist_manager_->ShutdownOnUIThread(); | 600 url_blacklist_manager_->ShutdownOnUIThread(); |
596 #endif | 601 #endif |
597 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); | 602 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); |
598 if (!posted) | 603 if (!posted) |
599 delete this; | 604 delete this; |
600 } | 605 } |
601 | 606 |
602 void ProfileIOData::set_server_bound_cert_service( | 607 void ProfileIOData::set_server_bound_cert_service( |
603 net::ServerBoundCertService* server_bound_cert_service) const { | 608 net::ServerBoundCertService* server_bound_cert_service) const { |
604 server_bound_cert_service_.reset(server_bound_cert_service); | 609 server_bound_cert_service_.reset(server_bound_cert_service); |
605 } | 610 } |
606 | 611 |
607 void ProfileIOData::DestroyResourceContext() { | 612 void ProfileIOData::DestroyResourceContext() { |
608 resource_context_.reset(); | 613 resource_context_.reset(); |
609 } | 614 } |
OLD | NEW |