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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 params->protocol_handler_url_interceptor.reset( | 190 params->protocol_handler_url_interceptor.reset( |
191 protocol_handler_registry->CreateURLInterceptor()); | 191 protocol_handler_registry->CreateURLInterceptor()); |
192 | 192 |
193 ChromeProxyConfigService* proxy_config_service = | 193 ChromeProxyConfigService* proxy_config_service = |
194 ProxyServiceFactory::CreateProxyConfigService(true); | 194 ProxyServiceFactory::CreateProxyConfigService(true); |
195 params->proxy_config_service.reset(proxy_config_service); | 195 params->proxy_config_service.reset(proxy_config_service); |
196 profile->GetProxyConfigTracker()->SetChromeProxyConfigService( | 196 profile->GetProxyConfigTracker()->SetChromeProxyConfigService( |
197 proxy_config_service); | 197 proxy_config_service); |
198 params->profile = profile; | 198 params->profile = profile; |
199 profile_params_.reset(params.release()); | 199 profile_params_.reset(params.release()); |
| 200 #if defined(ENABLE_PRINTING) |
| 201 printing_enabled_.Init(prefs::kPrintingEnabled, pref_service, NULL); |
| 202 printing_enabled_.MoveToThread(BrowserThread::IO); |
| 203 #endif |
200 | 204 |
201 // The URLBlacklistManager has to be created on the UI thread to register | 205 // The URLBlacklistManager has to be created on the UI thread to register |
202 // observers of |pref_service|, and it also has to clean up on | 206 // observers of |pref_service|, and it also has to clean up on |
203 // ShutdownOnUIThread to release these observers on the right thread. | 207 // ShutdownOnUIThread to release these observers on the right thread. |
204 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up, | 208 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up, |
205 // in particular when this ProfileIOData isn't |initialized_| during deletion. | 209 // in particular when this ProfileIOData isn't |initialized_| during deletion. |
206 #if defined(ENABLE_CONFIGURATION_POLICY) | 210 #if defined(ENABLE_CONFIGURATION_POLICY) |
207 url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service)); | 211 url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service)); |
208 #endif | 212 #endif |
209 | 213 |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 #endif // defined(OS_CHROMEOS) | 562 #endif // defined(OS_CHROMEOS) |
559 } | 563 } |
560 | 564 |
561 void ProfileIOData::ShutdownOnUIThread() { | 565 void ProfileIOData::ShutdownOnUIThread() { |
562 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 566 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
563 enable_referrers_.Destroy(); | 567 enable_referrers_.Destroy(); |
564 #if !defined(OS_CHROMEOS) | 568 #if !defined(OS_CHROMEOS) |
565 enable_metrics_.Destroy(); | 569 enable_metrics_.Destroy(); |
566 #endif | 570 #endif |
567 safe_browsing_enabled_.Destroy(); | 571 safe_browsing_enabled_.Destroy(); |
| 572 printing_enabled_.Destroy(); |
568 session_startup_pref_.Destroy(); | 573 session_startup_pref_.Destroy(); |
569 #if defined(ENABLE_CONFIGURATION_POLICY) | 574 #if defined(ENABLE_CONFIGURATION_POLICY) |
570 if (url_blacklist_manager_.get()) | 575 if (url_blacklist_manager_.get()) |
571 url_blacklist_manager_->ShutdownOnUIThread(); | 576 url_blacklist_manager_->ShutdownOnUIThread(); |
572 #endif | 577 #endif |
573 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); | 578 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); |
574 if (!posted) | 579 if (!posted) |
575 delete this; | 580 delete this; |
576 } | 581 } |
577 | 582 |
578 void ProfileIOData::set_server_bound_cert_service( | 583 void ProfileIOData::set_server_bound_cert_service( |
579 net::ServerBoundCertService* server_bound_cert_service) const { | 584 net::ServerBoundCertService* server_bound_cert_service) const { |
580 server_bound_cert_service_.reset(server_bound_cert_service); | 585 server_bound_cert_service_.reset(server_bound_cert_service); |
581 } | 586 } |
582 | 587 |
583 void ProfileIOData::DestroyResourceContext() { | 588 void ProfileIOData::DestroyResourceContext() { |
584 resource_context_.reset(); | 589 resource_context_.reset(); |
585 } | 590 } |
OLD | NEW |