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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 | 507 |
508 io_data_.Init(cookie_path, server_bound_cert_path, cache_path, | 508 io_data_.Init(cookie_path, server_bound_cert_path, cache_path, |
509 cache_max_size, media_cache_path, media_cache_max_size, | 509 cache_max_size, media_cache_path, media_cache_max_size, |
510 extensions_cookie_path, GetPath(), infinite_cache_path, | 510 extensions_cookie_path, GetPath(), infinite_cache_path, |
511 predictor_, | 511 predictor_, |
512 g_browser_process->local_state(), | 512 g_browser_process->local_state(), |
513 g_browser_process->io_thread(), | 513 g_browser_process->io_thread(), |
514 restore_old_session_cookies, | 514 restore_old_session_cookies, |
515 GetSpecialStoragePolicy()); | 515 GetSpecialStoragePolicy()); |
516 | 516 |
| 517 #if defined(ENABLE_PLUGINS) |
517 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( | 518 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( |
518 PluginPrefs::GetForProfile(this), | 519 PluginPrefs::GetForProfile(this), |
519 io_data_.GetResourceContextNoInit()); | 520 io_data_.GetResourceContextNoInit()); |
| 521 #endif |
520 | 522 |
521 // Delay README creation to not impact startup performance. | 523 // Delay README creation to not impact startup performance. |
522 BrowserThread::PostDelayedTask( | 524 BrowserThread::PostDelayedTask( |
523 BrowserThread::FILE, FROM_HERE, | 525 BrowserThread::FILE, FROM_HERE, |
524 base::Bind(&EnsureReadmeFile, GetPath()), | 526 base::Bind(&EnsureReadmeFile, GetPath()), |
525 base::TimeDelta::FromMilliseconds(create_readme_delay_ms)); | 527 base::TimeDelta::FromMilliseconds(create_readme_delay_ms)); |
526 | 528 |
527 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 529 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
528 switches::kDisableRestoreSessionState)) { | 530 switches::kDisableRestoreSessionState)) { |
529 content::BrowserContext::GetDefaultStoragePartition(this)-> | 531 content::BrowserContext::GetDefaultStoragePartition(this)-> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 bool prefs_loaded = prefs_->GetInitializationStatus() != | 588 bool prefs_loaded = prefs_->GetInitializationStatus() != |
587 PrefService::INITIALIZATION_STATUS_WAITING; | 589 PrefService::INITIALIZATION_STATUS_WAITING; |
588 | 590 |
589 #if defined(ENABLE_SESSION_SERVICE) | 591 #if defined(ENABLE_SESSION_SERVICE) |
590 StopCreateSessionServiceTimer(); | 592 StopCreateSessionServiceTimer(); |
591 #endif | 593 #endif |
592 | 594 |
593 // Remove pref observers | 595 // Remove pref observers |
594 pref_change_registrar_.RemoveAll(); | 596 pref_change_registrar_.RemoveAll(); |
595 | 597 |
| 598 #if defined(ENABLE_PLUGINS) |
596 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( | 599 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( |
597 io_data_.GetResourceContextNoInit()); | 600 io_data_.GetResourceContextNoInit()); |
| 601 #endif |
598 | 602 |
599 // Destroy OTR profile and its profile services first. | 603 // Destroy OTR profile and its profile services first. |
600 if (off_the_record_profile_.get()) { | 604 if (off_the_record_profile_.get()) { |
601 ProfileDestroyer::DestroyOffTheRecordProfileNow( | 605 ProfileDestroyer::DestroyOffTheRecordProfileNow( |
602 off_the_record_profile_.get()); | 606 off_the_record_profile_.get()); |
603 } else { | 607 } else { |
604 ExtensionPrefValueMapFactory::GetForProfile(this)-> | 608 ExtensionPrefValueMapFactory::GetForProfile(this)-> |
605 ClearAllIncognitoSessionOnlyPreferences(); | 609 ClearAllIncognitoSessionOnlyPreferences(); |
606 } | 610 } |
607 | 611 |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 if (!path.empty()) | 1160 if (!path.empty()) |
1157 *cache_path = path; | 1161 *cache_path = path; |
1158 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1162 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1159 prefs_->GetInteger(prefs::kDiskCacheSize); | 1163 prefs_->GetInteger(prefs::kDiskCacheSize); |
1160 } | 1164 } |
1161 | 1165 |
1162 base::Callback<ChromeURLDataManagerBackend*(void)> | 1166 base::Callback<ChromeURLDataManagerBackend*(void)> |
1163 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { | 1167 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
1164 return io_data_.GetChromeURLDataManagerBackendGetter(); | 1168 return io_data_.GetChromeURLDataManagerBackendGetter(); |
1165 } | 1169 } |
OLD | NEW |