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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "chrome/browser/net/predictor.h" | 50 #include "chrome/browser/net/predictor.h" |
51 #include "chrome/browser/net/proxy_service_factory.h" | 51 #include "chrome/browser/net/proxy_service_factory.h" |
52 #include "chrome/browser/net/ssl_config_service_manager.h" | 52 #include "chrome/browser/net/ssl_config_service_manager.h" |
53 #include "chrome/browser/net/url_fixer_upper.h" | 53 #include "chrome/browser/net/url_fixer_upper.h" |
54 #include "chrome/browser/plugins/plugin_prefs.h" | 54 #include "chrome/browser/plugins/plugin_prefs.h" |
55 #include "chrome/browser/prefs/browser_prefs.h" | 55 #include "chrome/browser/prefs/browser_prefs.h" |
56 #include "chrome/browser/prefs/chrome_pref_service_factory.h" | 56 #include "chrome/browser/prefs/chrome_pref_service_factory.h" |
57 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 57 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
58 #include "chrome/browser/prerender/prerender_manager_factory.h" | 58 #include "chrome/browser/prerender/prerender_manager_factory.h" |
59 #include "chrome/browser/profiles/chrome_version_service.h" | 59 #include "chrome/browser/profiles/chrome_version_service.h" |
60 #include "chrome/browser/profiles/gaia_info_update_service.h" | 60 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" |
61 #include "chrome/browser/profiles/profile_dependency_manager.h" | 61 #include "chrome/browser/profiles/profile_dependency_manager.h" |
62 #include "chrome/browser/profiles/profile_destroyer.h" | 62 #include "chrome/browser/profiles/profile_destroyer.h" |
63 #include "chrome/browser/profiles/profile_info_cache.h" | 63 #include "chrome/browser/profiles/profile_info_cache.h" |
64 #include "chrome/browser/profiles/profile_manager.h" | 64 #include "chrome/browser/profiles/profile_manager.h" |
65 #include "chrome/browser/search_engines/template_url_fetcher.h" | 65 #include "chrome/browser/search_engines/template_url_fetcher.h" |
66 #include "chrome/browser/sessions/session_service_factory.h" | 66 #include "chrome/browser/sessions/session_service_factory.h" |
67 #include "chrome/browser/speech/chrome_speech_recognition_preferences.h" | 67 #include "chrome/browser/speech/chrome_speech_recognition_preferences.h" |
68 #include "chrome/browser/sync/profile_sync_service_factory.h" | 68 #include "chrome/browser/sync/profile_sync_service_factory.h" |
69 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 69 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
70 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 70 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 // Always create the cache directory asynchronously. | 425 // Always create the cache directory asynchronously. |
426 scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner = | 426 scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner = |
427 JsonPrefStore::GetTaskRunnerForFile(base_cache_path_, | 427 JsonPrefStore::GetTaskRunnerForFile(base_cache_path_, |
428 BrowserThread::GetBlockingPool()); | 428 BrowserThread::GetBlockingPool()); |
429 CreateProfileDirectory(sequenced_task_runner, base_cache_path_); | 429 CreateProfileDirectory(sequenced_task_runner, base_cache_path_); |
430 | 430 |
431 // Now that the profile is hooked up to receive pref change notifications to | 431 // Now that the profile is hooked up to receive pref change notifications to |
432 // kGoogleServicesUsername, initialize components that depend on it to reflect | 432 // kGoogleServicesUsername, initialize components that depend on it to reflect |
433 // the current value. | 433 // the current value. |
434 UpdateProfileUserNameCache(); | 434 UpdateProfileUserNameCache(); |
435 GetGAIAInfoUpdateService(); | 435 GAIAInfoUpdateServiceFactory::GetForProfile(this); |
436 | 436 |
437 #if !defined(OS_CHROMEOS) | 437 #if !defined(OS_CHROMEOS) |
438 // Listen for bookmark model load, to bootstrap the sync service. | 438 // Listen for bookmark model load, to bootstrap the sync service. |
439 // On CrOS sync service will be initialized after sign in. | 439 // On CrOS sync service will be initialized after sign in. |
440 registrar_.Add(this, chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED, | 440 registrar_.Add(this, chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED, |
441 content::Source<Profile>(this)); | 441 content::Source<Profile>(this)); |
442 #endif | 442 #endif |
443 | 443 |
444 PrefService* local_state = g_browser_process->local_state(); | 444 PrefService* local_state = g_browser_process->local_state(); |
445 ssl_config_service_manager_.reset( | 445 ssl_config_service_manager_.reset( |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 | 868 |
869 content::SpeechRecognitionPreferences* | 869 content::SpeechRecognitionPreferences* |
870 ProfileImpl::GetSpeechRecognitionPreferences() { | 870 ProfileImpl::GetSpeechRecognitionPreferences() { |
871 #if defined(ENABLE_INPUT_SPEECH) | 871 #if defined(ENABLE_INPUT_SPEECH) |
872 return ChromeSpeechRecognitionPreferences::GetForProfile(this); | 872 return ChromeSpeechRecognitionPreferences::GetForProfile(this); |
873 #else | 873 #else |
874 return NULL; | 874 return NULL; |
875 #endif | 875 #endif |
876 } | 876 } |
877 | 877 |
878 GAIAInfoUpdateService* ProfileImpl::GetGAIAInfoUpdateService() { | |
879 if (!gaia_info_update_service_.get() && | |
880 GAIAInfoUpdateService::ShouldUseGAIAProfileInfo(this)) { | |
881 gaia_info_update_service_.reset(new GAIAInfoUpdateService(this)); | |
882 } | |
883 return gaia_info_update_service_.get(); | |
884 } | |
885 | |
886 DownloadManagerDelegate* ProfileImpl::GetDownloadManagerDelegate() { | 878 DownloadManagerDelegate* ProfileImpl::GetDownloadManagerDelegate() { |
887 return DownloadServiceFactory::GetForProfile(this)-> | 879 return DownloadServiceFactory::GetForProfile(this)-> |
888 GetDownloadManagerDelegate(); | 880 GetDownloadManagerDelegate(); |
889 } | 881 } |
890 | 882 |
891 quota::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() { | 883 quota::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() { |
892 return GetExtensionSpecialStoragePolicy(); | 884 return GetExtensionSpecialStoragePolicy(); |
893 } | 885 } |
894 | 886 |
895 ProtocolHandlerRegistry* ProfileImpl::GetProtocolHandlerRegistry() { | 887 ProtocolHandlerRegistry* ProfileImpl::GetProtocolHandlerRegistry() { |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 if (!path.empty()) | 1147 if (!path.empty()) |
1156 *cache_path = path; | 1148 *cache_path = path; |
1157 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1149 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1158 prefs_->GetInteger(prefs::kDiskCacheSize); | 1150 prefs_->GetInteger(prefs::kDiskCacheSize); |
1159 } | 1151 } |
1160 | 1152 |
1161 base::Callback<ChromeURLDataManagerBackend*(void)> | 1153 base::Callback<ChromeURLDataManagerBackend*(void)> |
1162 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { | 1154 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
1163 return io_data_.GetChromeURLDataManagerBackendGetter(); | 1155 return io_data_.GetChromeURLDataManagerBackendGetter(); |
1164 } | 1156 } |
OLD | NEW |