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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 #include "content/public/browser/browser_thread.h" | 108 #include "content/public/browser/browser_thread.h" |
109 #include "content/public/browser/dom_storage_context.h" | 109 #include "content/public/browser/dom_storage_context.h" |
110 #include "content/public/browser/notification_service.h" | 110 #include "content/public/browser/notification_service.h" |
111 #include "content/public/browser/render_process_host.h" | 111 #include "content/public/browser/render_process_host.h" |
112 #include "content/public/browser/storage_partition.h" | 112 #include "content/public/browser/storage_partition.h" |
113 #include "content/public/browser/url_data_source.h" | 113 #include "content/public/browser/url_data_source.h" |
114 #include "content/public/browser/user_metrics.h" | 114 #include "content/public/browser/user_metrics.h" |
115 #include "content/public/common/content_constants.h" | 115 #include "content/public/common/content_constants.h" |
116 #include "content/public/common/page_zoom.h" | 116 #include "content/public/common/page_zoom.h" |
117 #include "extensions/features/features.h" | 117 #include "extensions/features/features.h" |
| 118 #include "ppapi/features/features.h" |
118 #include "printing/features/features.h" | 119 #include "printing/features/features.h" |
119 #include "ui/base/l10n/l10n_util.h" | 120 #include "ui/base/l10n/l10n_util.h" |
120 | 121 |
121 #if defined(OS_CHROMEOS) | 122 #if defined(OS_CHROMEOS) |
122 #include "chrome/browser/chromeos/locale_change_guard.h" | 123 #include "chrome/browser/chromeos/locale_change_guard.h" |
123 #include "chrome/browser/chromeos/preferences.h" | 124 #include "chrome/browser/chromeos/preferences.h" |
124 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 125 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
125 #include "components/user_manager/user_manager.h" | 126 #include "components/user_manager/user_manager.h" |
126 #endif | 127 #endif |
127 | 128 |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 | 615 |
615 // Make sure we initialize the ProfileIOData after everything else has been | 616 // Make sure we initialize the ProfileIOData after everything else has been |
616 // initialized that we might be reading from the IO thread. | 617 // initialized that we might be reading from the IO thread. |
617 | 618 |
618 io_data_.Init(cookie_path, channel_id_path, cache_path, | 619 io_data_.Init(cookie_path, channel_id_path, cache_path, |
619 cache_max_size, media_cache_path, media_cache_max_size, | 620 cache_max_size, media_cache_path, media_cache_max_size, |
620 extensions_cookie_path, GetPath(), predictor_, | 621 extensions_cookie_path, GetPath(), predictor_, |
621 session_cookie_mode, GetSpecialStoragePolicy(), | 622 session_cookie_mode, GetSpecialStoragePolicy(), |
622 CreateDomainReliabilityMonitor(local_state)); | 623 CreateDomainReliabilityMonitor(local_state)); |
623 | 624 |
624 #if defined(ENABLE_PLUGINS) | 625 #if BUILDFLAG(ENABLE_PLUGINS) |
625 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( | 626 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( |
626 this, io_data_.GetResourceContextNoInit()); | 627 this, io_data_.GetResourceContextNoInit()); |
627 #endif | 628 #endif |
628 | 629 |
629 TRACE_EVENT0("browser", "ProfileImpl::SetSaveSessionStorageOnDisk"); | 630 TRACE_EVENT0("browser", "ProfileImpl::SetSaveSessionStorageOnDisk"); |
630 content::BrowserContext::GetDefaultStoragePartition(this)-> | 631 content::BrowserContext::GetDefaultStoragePartition(this)-> |
631 GetDOMStorageContext()->SetSaveSessionStorageOnDisk(); | 632 GetDOMStorageContext()->SetSaveSessionStorageOnDisk(); |
632 | 633 |
633 // The DomDistillerViewerSource is not a normal WebUI so it must be registered | 634 // The DomDistillerViewerSource is not a normal WebUI so it must be registered |
634 // as a URLDataSource early. | 635 // as a URLDataSource early. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 bool prefs_loaded = prefs_->GetInitializationStatus() != | 682 bool prefs_loaded = prefs_->GetInitializationStatus() != |
682 PrefService::INITIALIZATION_STATUS_WAITING; | 683 PrefService::INITIALIZATION_STATUS_WAITING; |
683 | 684 |
684 #if BUILDFLAG(ENABLE_SESSION_SERVICE) | 685 #if BUILDFLAG(ENABLE_SESSION_SERVICE) |
685 StopCreateSessionServiceTimer(); | 686 StopCreateSessionServiceTimer(); |
686 #endif | 687 #endif |
687 | 688 |
688 // Remove pref observers | 689 // Remove pref observers |
689 pref_change_registrar_.RemoveAll(); | 690 pref_change_registrar_.RemoveAll(); |
690 | 691 |
691 #if defined(ENABLE_PLUGINS) | 692 #if BUILDFLAG(ENABLE_PLUGINS) |
692 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( | 693 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( |
693 io_data_.GetResourceContextNoInit()); | 694 io_data_.GetResourceContextNoInit()); |
694 #endif | 695 #endif |
695 | 696 |
696 // Destroy OTR profile and its profile services first. | 697 // Destroy OTR profile and its profile services first. |
697 if (off_the_record_profile_) { | 698 if (off_the_record_profile_) { |
698 ProfileDestroyer::DestroyOffTheRecordProfileNow( | 699 ProfileDestroyer::DestroyOffTheRecordProfileNow( |
699 off_the_record_profile_.get()); | 700 off_the_record_profile_.get()); |
700 } else { | 701 } else { |
701 #if BUILDFLAG(ENABLE_EXTENSIONS) | 702 #if BUILDFLAG(ENABLE_EXTENSIONS) |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1275 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1275 domain_reliability::DomainReliabilityService* service = | 1276 domain_reliability::DomainReliabilityService* service = |
1276 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1277 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1277 GetForBrowserContext(this); | 1278 GetForBrowserContext(this); |
1278 if (!service) | 1279 if (!service) |
1279 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1280 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1280 | 1281 |
1281 return service->CreateMonitor( | 1282 return service->CreateMonitor( |
1282 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 1283 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
1283 } | 1284 } |
OLD | NEW |