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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 216 |
217 params->host_content_settings_map = profile->GetHostContentSettingsMap(); | 217 params->host_content_settings_map = profile->GetHostContentSettingsMap(); |
218 params->cookie_settings = CookieSettings::Factory::GetForProfile(profile); | 218 params->cookie_settings = CookieSettings::Factory::GetForProfile(profile); |
219 params->ssl_config_service = profile->GetSSLConfigService(); | 219 params->ssl_config_service = profile->GetSSLConfigService(); |
220 base::Callback<Profile*(void)> profile_getter = | 220 base::Callback<Profile*(void)> profile_getter = |
221 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), | 221 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), |
222 profile); | 222 profile); |
223 params->cookie_monster_delegate = | 223 params->cookie_monster_delegate = |
224 new ChromeCookieMonsterDelegate(profile_getter); | 224 new ChromeCookieMonsterDelegate(profile_getter); |
225 params->extension_info_map = profile->GetExtensionInfoMap(); | 225 params->extension_info_map = profile->GetExtensionInfoMap(); |
| 226 |
| 227 #if defined(ENABLE_NOTIFICATIONS) |
226 params->notification_service = | 228 params->notification_service = |
227 DesktopNotificationServiceFactory::GetForProfile(profile); | 229 DesktopNotificationServiceFactory::GetForProfile(profile); |
| 230 #endif |
| 231 |
228 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); | 232 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); |
229 | 233 |
230 ChromeProxyConfigService* proxy_config_service = | 234 ChromeProxyConfigService* proxy_config_service = |
231 ProxyServiceFactory::CreateProxyConfigService(true); | 235 ProxyServiceFactory::CreateProxyConfigService(true); |
232 params->proxy_config_service.reset(proxy_config_service); | 236 params->proxy_config_service.reset(proxy_config_service); |
233 profile->GetProxyConfigTracker()->SetChromeProxyConfigService( | 237 profile->GetProxyConfigTracker()->SetChromeProxyConfigService( |
234 proxy_config_service); | 238 proxy_config_service); |
235 params->profile = profile; | 239 params->profile = profile; |
236 profile_params_.reset(params.release()); | 240 profile_params_.reset(params.release()); |
237 | 241 |
(...skipping 26 matching lines...) Expand all Loading... |
264 void ProfileIOData::AppRequestContext::SetHttpTransactionFactory( | 268 void ProfileIOData::AppRequestContext::SetHttpTransactionFactory( |
265 net::HttpTransactionFactory* http_factory) { | 269 net::HttpTransactionFactory* http_factory) { |
266 http_factory_.reset(http_factory); | 270 http_factory_.reset(http_factory); |
267 set_http_transaction_factory(http_factory); | 271 set_http_transaction_factory(http_factory); |
268 } | 272 } |
269 | 273 |
270 ProfileIOData::ProfileParams::ProfileParams() | 274 ProfileIOData::ProfileParams::ProfileParams() |
271 : is_incognito(false), | 275 : is_incognito(false), |
272 clear_local_state_on_exit(false), | 276 clear_local_state_on_exit(false), |
273 io_thread(NULL), | 277 io_thread(NULL), |
| 278 #if defined(ENABLE_NOTIFICATIONS) |
274 notification_service(NULL), | 279 notification_service(NULL), |
| 280 #endif |
275 profile(NULL) {} | 281 profile(NULL) {} |
276 ProfileIOData::ProfileParams::~ProfileParams() {} | 282 ProfileIOData::ProfileParams::~ProfileParams() {} |
277 | 283 |
278 ProfileIOData::ProfileIOData(bool is_incognito) | 284 ProfileIOData::ProfileIOData(bool is_incognito) |
279 : initialized_(false), | 285 : initialized_(false), |
280 ALLOW_THIS_IN_INITIALIZER_LIST(resource_context_(this)), | 286 ALLOW_THIS_IN_INITIALIZER_LIST(resource_context_(this)), |
281 initialized_on_UI_thread_(false) { | 287 initialized_on_UI_thread_(false) { |
282 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 288 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
283 } | 289 } |
284 | 290 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 } | 380 } |
375 | 381 |
376 HostContentSettingsMap* ProfileIOData::GetHostContentSettingsMap() const { | 382 HostContentSettingsMap* ProfileIOData::GetHostContentSettingsMap() const { |
377 return host_content_settings_map_; | 383 return host_content_settings_map_; |
378 } | 384 } |
379 | 385 |
380 CookieSettings* ProfileIOData::GetCookieSettings() const { | 386 CookieSettings* ProfileIOData::GetCookieSettings() const { |
381 return cookie_settings_; | 387 return cookie_settings_; |
382 } | 388 } |
383 | 389 |
| 390 #if defined(ENABLE_NOTIFICATIONS) |
384 DesktopNotificationService* ProfileIOData::GetNotificationService() const { | 391 DesktopNotificationService* ProfileIOData::GetNotificationService() const { |
385 return notification_service_; | 392 return notification_service_; |
386 } | 393 } |
| 394 #endif |
387 | 395 |
388 ProfileIOData::ResourceContext::ResourceContext(ProfileIOData* io_data) | 396 ProfileIOData::ResourceContext::ResourceContext(ProfileIOData* io_data) |
389 : io_data_(io_data) { | 397 : io_data_(io_data) { |
390 DCHECK(io_data); | 398 DCHECK(io_data); |
391 } | 399 } |
392 | 400 |
393 ProfileIOData::ResourceContext::~ResourceContext() {} | 401 ProfileIOData::ResourceContext::~ResourceContext() {} |
394 | 402 |
395 void ProfileIOData::ResourceContext::EnsureInitialized() { | 403 void ProfileIOData::ResourceContext::EnsureInitialized() { |
396 io_data_->LazyInitialize(); | 404 io_data_->LazyInitialize(); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 // Install the GView request interceptor that will redirect requests | 508 // Install the GView request interceptor that will redirect requests |
501 // of compatible documents (PDF, etc) to the GView document viewer. | 509 // of compatible documents (PDF, etc) to the GView document viewer. |
502 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 510 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
503 if (parsed_command_line.HasSwitch(switches::kEnableGView)) | 511 if (parsed_command_line.HasSwitch(switches::kEnableGView)) |
504 job_factory_->AddInterceptor(new chromeos::GViewRequestInterceptor); | 512 job_factory_->AddInterceptor(new chromeos::GViewRequestInterceptor); |
505 #endif // defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) | 513 #endif // defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) |
506 | 514 |
507 // Take ownership over these parameters. | 515 // Take ownership over these parameters. |
508 host_content_settings_map_ = profile_params_->host_content_settings_map; | 516 host_content_settings_map_ = profile_params_->host_content_settings_map; |
509 cookie_settings_ = profile_params_->cookie_settings; | 517 cookie_settings_ = profile_params_->cookie_settings; |
| 518 #if defined(ENABLE_NOTIFICATIONS) |
510 notification_service_ = profile_params_->notification_service; | 519 notification_service_ = profile_params_->notification_service; |
| 520 #endif |
511 extension_info_map_ = profile_params_->extension_info_map; | 521 extension_info_map_ = profile_params_->extension_info_map; |
512 | 522 |
513 resource_context_.host_resolver_ = io_thread_globals->host_resolver.get(); | 523 resource_context_.host_resolver_ = io_thread_globals->host_resolver.get(); |
514 resource_context_.request_context_ = main_request_context_; | 524 resource_context_.request_context_ = main_request_context_; |
515 resource_context_.media_observer_ = | 525 resource_context_.media_observer_ = |
516 io_thread_globals->media.media_internals.get(); | 526 io_thread_globals->media.media_internals.get(); |
517 | 527 |
518 LazyInitializeInternal(profile_params_.get()); | 528 LazyInitializeInternal(profile_params_.get()); |
519 | 529 |
520 profile_params_.reset(); | 530 profile_params_.reset(); |
(...skipping 27 matching lines...) Expand all Loading... |
548 &resource_context_)); | 558 &resource_context_)); |
549 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); | 559 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); |
550 if (!posted) | 560 if (!posted) |
551 delete this; | 561 delete this; |
552 } | 562 } |
553 | 563 |
554 void ProfileIOData::set_origin_bound_cert_service( | 564 void ProfileIOData::set_origin_bound_cert_service( |
555 net::OriginBoundCertService* origin_bound_cert_service) const { | 565 net::OriginBoundCertService* origin_bound_cert_service) const { |
556 origin_bound_cert_service_.reset(origin_bound_cert_service); | 566 origin_bound_cert_service_.reset(origin_bound_cert_service); |
557 } | 567 } |
OLD | NEW |