| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #include "chrome/browser/prefs/pref_service_syncable.h" | 53 #include "chrome/browser/prefs/pref_service_syncable.h" |
| 54 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" | 54 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" |
| 55 #include "chrome/browser/prerender/prerender_manager_factory.h" | 55 #include "chrome/browser/prerender/prerender_manager_factory.h" |
| 56 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" | 56 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" |
| 57 #include "chrome/browser/profiles/chrome_version_service.h" | 57 #include "chrome/browser/profiles/chrome_version_service.h" |
| 58 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" | 58 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" |
| 59 #include "chrome/browser/profiles/profile_destroyer.h" | 59 #include "chrome/browser/profiles/profile_destroyer.h" |
| 60 #include "chrome/browser/profiles/profile_info_cache.h" | 60 #include "chrome/browser/profiles/profile_info_cache.h" |
| 61 #include "chrome/browser/profiles/profile_manager.h" | 61 #include "chrome/browser/profiles/profile_manager.h" |
| 62 #include "chrome/browser/profiles/profile_metrics.h" | 62 #include "chrome/browser/profiles/profile_metrics.h" |
| 63 #include "chrome/browser/push_messaging/push_messaging_service_factory.h" |
| 64 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" |
| 63 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 65 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 64 #include "chrome/browser/services/gcm/gcm_profile_service.h" | 66 #include "chrome/browser/services/gcm/gcm_profile_service.h" |
| 65 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" | |
| 66 #include "chrome/browser/services/gcm/push_messaging_service_impl.h" | |
| 67 #include "chrome/browser/sessions/session_service_factory.h" | 67 #include "chrome/browser/sessions/session_service_factory.h" |
| 68 #include "chrome/browser/signin/signin_manager_factory.h" | 68 #include "chrome/browser/signin/signin_manager_factory.h" |
| 69 #include "chrome/browser/signin/signin_ui_util.h" | 69 #include "chrome/browser/signin/signin_ui_util.h" |
| 70 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" | 70 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" |
| 71 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" | 71 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" |
| 72 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 72 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
| 73 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" | 73 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" |
| 74 #include "chrome/common/chrome_constants.h" | 74 #include "chrome/common/chrome_constants.h" |
| 75 #include "chrome/common/chrome_paths_internal.h" | 75 #include "chrome/common/chrome_paths_internal.h" |
| 76 #include "chrome/common/chrome_switches.h" | 76 #include "chrome/common/chrome_switches.h" |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 content::Source<Profile>(this), | 684 content::Source<Profile>(this), |
| 685 content::NotificationService::NoDetails()); | 685 content::NotificationService::NoDetails()); |
| 686 | 686 |
| 687 #if !defined(OS_CHROMEOS) | 687 #if !defined(OS_CHROMEOS) |
| 688 // Listen for bookmark model load, to bootstrap the sync service. | 688 // Listen for bookmark model load, to bootstrap the sync service. |
| 689 // On CrOS sync service will be initialized after sign in. | 689 // On CrOS sync service will be initialized after sign in. |
| 690 BookmarkModel* model = BookmarkModelFactory::GetForProfile(this); | 690 BookmarkModel* model = BookmarkModelFactory::GetForProfile(this); |
| 691 model->AddObserver(new BookmarkModelLoadedObserver(this)); | 691 model->AddObserver(new BookmarkModelLoadedObserver(this)); |
| 692 #endif | 692 #endif |
| 693 | 693 |
| 694 gcm::PushMessagingServiceImpl::InitializeForProfile(this); | 694 PushMessagingServiceImpl::InitializeForProfile(this); |
| 695 | 695 |
| 696 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && !defined(OS_IOS) | 696 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && !defined(OS_IOS) |
| 697 signin_ui_util::InitializePrefsForProfile(this); | 697 signin_ui_util::InitializePrefsForProfile(this); |
| 698 #endif | 698 #endif |
| 699 } | 699 } |
| 700 | 700 |
| 701 base::FilePath ProfileImpl::last_selected_directory() { | 701 base::FilePath ProfileImpl::last_selected_directory() { |
| 702 return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); | 702 return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); |
| 703 } | 703 } |
| 704 | 704 |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1059 | 1059 |
| 1060 storage::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() { | 1060 storage::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() { |
| 1061 #if defined(ENABLE_EXTENSIONS) | 1061 #if defined(ENABLE_EXTENSIONS) |
| 1062 return GetExtensionSpecialStoragePolicy(); | 1062 return GetExtensionSpecialStoragePolicy(); |
| 1063 #else | 1063 #else |
| 1064 return NULL; | 1064 return NULL; |
| 1065 #endif | 1065 #endif |
| 1066 } | 1066 } |
| 1067 | 1067 |
| 1068 content::PushMessagingService* ProfileImpl::GetPushMessagingService() { | 1068 content::PushMessagingService* ProfileImpl::GetPushMessagingService() { |
| 1069 return gcm::GCMProfileServiceFactory::GetForProfile( | 1069 return PushMessagingServiceFactory::GetForProfile(this); |
| 1070 this)->push_messaging_service(); | |
| 1071 } | 1070 } |
| 1072 | 1071 |
| 1073 content::SSLHostStateDelegate* ProfileImpl::GetSSLHostStateDelegate() { | 1072 content::SSLHostStateDelegate* ProfileImpl::GetSSLHostStateDelegate() { |
| 1074 return ChromeSSLHostStateDelegateFactory::GetForProfile(this); | 1073 return ChromeSSLHostStateDelegateFactory::GetForProfile(this); |
| 1075 } | 1074 } |
| 1076 | 1075 |
| 1077 bool ProfileImpl::IsSameProfile(Profile* profile) { | 1076 bool ProfileImpl::IsSameProfile(Profile* profile) { |
| 1078 if (profile == static_cast<Profile*>(this)) | 1077 if (profile == static_cast<Profile*>(this)) |
| 1079 return true; | 1078 return true; |
| 1080 Profile* otr_profile = off_the_record_profile_.get(); | 1079 Profile* otr_profile = off_the_record_profile_.get(); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1323 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1322 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
| 1324 domain_reliability::DomainReliabilityService* service = | 1323 domain_reliability::DomainReliabilityService* service = |
| 1325 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1324 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
| 1326 GetForBrowserContext(this); | 1325 GetForBrowserContext(this); |
| 1327 if (!service) | 1326 if (!service) |
| 1328 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1327 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
| 1329 | 1328 |
| 1330 return service->CreateMonitor( | 1329 return service->CreateMonitor( |
| 1331 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1330 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
| 1332 } | 1331 } |
| OLD | NEW |