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" | |
63 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 64 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
64 #include "chrome/browser/services/gcm/gcm_profile_service.h" | 65 #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" | 66 #include "chrome/browser/sessions/session_service_factory.h" |
68 #include "chrome/browser/signin/signin_manager_factory.h" | 67 #include "chrome/browser/signin/signin_manager_factory.h" |
69 #include "chrome/browser/signin/signin_ui_util.h" | 68 #include "chrome/browser/signin/signin_ui_util.h" |
70 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" | 69 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" |
71 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" | 70 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" |
72 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 71 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
73 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" | 72 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" |
74 #include "chrome/common/chrome_constants.h" | 73 #include "chrome/common/chrome_constants.h" |
75 #include "chrome/common/chrome_paths_internal.h" | 74 #include "chrome/common/chrome_paths_internal.h" |
76 #include "chrome/common/chrome_switches.h" | 75 #include "chrome/common/chrome_switches.h" |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
684 content::Source<Profile>(this), | 683 content::Source<Profile>(this), |
685 content::NotificationService::NoDetails()); | 684 content::NotificationService::NoDetails()); |
686 | 685 |
687 #if !defined(OS_CHROMEOS) | 686 #if !defined(OS_CHROMEOS) |
688 // Listen for bookmark model load, to bootstrap the sync service. | 687 // Listen for bookmark model load, to bootstrap the sync service. |
689 // On CrOS sync service will be initialized after sign in. | 688 // On CrOS sync service will be initialized after sign in. |
690 BookmarkModel* model = BookmarkModelFactory::GetForProfile(this); | 689 BookmarkModel* model = BookmarkModelFactory::GetForProfile(this); |
691 model->AddObserver(new BookmarkModelLoadedObserver(this)); | 690 model->AddObserver(new BookmarkModelLoadedObserver(this)); |
692 #endif | 691 #endif |
693 | 692 |
694 gcm::PushMessagingServiceImpl::InitializeForProfile(this); | |
Peter Beverloo
2015/02/25 23:55:05
I think we need to keep this.
The reason that we'
kbalazs
2015/02/27 22:40:36
Yes, I missed it. I put it back.
| |
695 | |
696 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && !defined(OS_IOS) | 693 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && !defined(OS_IOS) |
697 signin_ui_util::InitializePrefsForProfile(this); | 694 signin_ui_util::InitializePrefsForProfile(this); |
698 #endif | 695 #endif |
699 } | 696 } |
700 | 697 |
701 base::FilePath ProfileImpl::last_selected_directory() { | 698 base::FilePath ProfileImpl::last_selected_directory() { |
702 return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); | 699 return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); |
703 } | 700 } |
704 | 701 |
705 void ProfileImpl::set_last_selected_directory(const base::FilePath& path) { | 702 void ProfileImpl::set_last_selected_directory(const base::FilePath& path) { |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1060 | 1057 |
1061 storage::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() { | 1058 storage::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() { |
1062 #if defined(ENABLE_EXTENSIONS) | 1059 #if defined(ENABLE_EXTENSIONS) |
1063 return GetExtensionSpecialStoragePolicy(); | 1060 return GetExtensionSpecialStoragePolicy(); |
1064 #else | 1061 #else |
1065 return NULL; | 1062 return NULL; |
1066 #endif | 1063 #endif |
1067 } | 1064 } |
1068 | 1065 |
1069 content::PushMessagingService* ProfileImpl::GetPushMessagingService() { | 1066 content::PushMessagingService* ProfileImpl::GetPushMessagingService() { |
1070 return gcm::GCMProfileServiceFactory::GetForProfile( | 1067 return PushMessagingServiceFactory::GetForProfile(this); |
1071 this)->push_messaging_service(); | |
1072 } | 1068 } |
1073 | 1069 |
1074 content::SSLHostStateDelegate* ProfileImpl::GetSSLHostStateDelegate() { | 1070 content::SSLHostStateDelegate* ProfileImpl::GetSSLHostStateDelegate() { |
1075 return ChromeSSLHostStateDelegateFactory::GetForProfile(this); | 1071 return ChromeSSLHostStateDelegateFactory::GetForProfile(this); |
1076 } | 1072 } |
1077 | 1073 |
1078 bool ProfileImpl::IsSameProfile(Profile* profile) { | 1074 bool ProfileImpl::IsSameProfile(Profile* profile) { |
1079 if (profile == static_cast<Profile*>(this)) | 1075 if (profile == static_cast<Profile*>(this)) |
1080 return true; | 1076 return true; |
1081 Profile* otr_profile = off_the_record_profile_.get(); | 1077 Profile* otr_profile = off_the_record_profile_.get(); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1324 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1320 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1325 domain_reliability::DomainReliabilityService* service = | 1321 domain_reliability::DomainReliabilityService* service = |
1326 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1322 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1327 GetForBrowserContext(this); | 1323 GetForBrowserContext(this); |
1328 if (!service) | 1324 if (!service) |
1329 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1325 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1330 | 1326 |
1331 return service->CreateMonitor( | 1327 return service->CreateMonitor( |
1332 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1328 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
1333 } | 1329 } |
OLD | NEW |