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