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/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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.h" | 58 #include "chrome/browser/profiles/gaia_info_update_service.h" |
59 #include "chrome/browser/profiles/profile_dependency_manager.h" | 59 #include "chrome/browser/profiles/profile_dependency_manager.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/search_engines/template_url_fetcher.h" | 62 #include "chrome/browser/search_engines/template_url_fetcher.h" |
63 #include "chrome/browser/sessions/session_service_factory.h" | 63 #include "chrome/browser/sessions/session_service_factory.h" |
64 #include "chrome/browser/speech/chrome_speech_recognition_preferences.h" | 64 #include "chrome/browser/speech/chrome_speech_recognition_preferences.h" |
65 #include "chrome/browser/sync/profile_sync_service_factory.h" | 65 #include "chrome/browser/sync/profile_sync_service_factory.h" |
66 #include "chrome/browser/ui/browser_init.h" | 66 #include "chrome/browser/ui/browser_init.h" |
67 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | |
68 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 67 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
69 #include "chrome/browser/user_style_sheet_watcher.h" | 68 #include "chrome/browser/user_style_sheet_watcher.h" |
70 #include "chrome/browser/visitedlink/visitedlink_event_listener.h" | 69 #include "chrome/browser/visitedlink/visitedlink_event_listener.h" |
71 #include "chrome/browser/visitedlink/visitedlink_master.h" | 70 #include "chrome/browser/visitedlink/visitedlink_master.h" |
72 #include "chrome/browser/web_resource/promo_resource_service.h" | 71 #include "chrome/browser/web_resource/promo_resource_service.h" |
73 #include "chrome/browser/webdata/web_data_service.h" | 72 #include "chrome/browser/webdata/web_data_service.h" |
74 #include "chrome/common/chrome_constants.h" | 73 #include "chrome/common/chrome_constants.h" |
75 #include "chrome/common/chrome_notification_types.h" | 74 #include "chrome/common/chrome_notification_types.h" |
76 #include "chrome/common/chrome_paths_internal.h" | 75 #include "chrome/common/chrome_paths_internal.h" |
77 #include "chrome/common/chrome_switches.h" | 76 #include "chrome/common/chrome_switches.h" |
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 #if defined(ENABLE_SESSION_SERVICE) | 967 #if defined(ENABLE_SESSION_SERVICE) |
969 void ProfileImpl::StopCreateSessionServiceTimer() { | 968 void ProfileImpl::StopCreateSessionServiceTimer() { |
970 create_session_service_timer_.Stop(); | 969 create_session_service_timer_.Stop(); |
971 } | 970 } |
972 | 971 |
973 void ProfileImpl::EnsureSessionServiceCreated() { | 972 void ProfileImpl::EnsureSessionServiceCreated() { |
974 SessionServiceFactory::GetForProfile(this); | 973 SessionServiceFactory::GetForProfile(this); |
975 } | 974 } |
976 #endif | 975 #endif |
977 | 976 |
978 ChromeURLDataManager* ProfileImpl::GetChromeURLDataManager() { | |
979 if (!chrome_url_data_manager_.get()) | |
980 chrome_url_data_manager_.reset(new ChromeURLDataManager( | |
981 io_data_.GetChromeURLDataManagerBackendGetter())); | |
982 return chrome_url_data_manager_.get(); | |
983 } | |
984 | |
985 #if defined(OS_CHROMEOS) | 977 #if defined(OS_CHROMEOS) |
986 void ProfileImpl::ChangeAppLocale( | 978 void ProfileImpl::ChangeAppLocale( |
987 const std::string& new_locale, AppLocaleChangedVia via) { | 979 const std::string& new_locale, AppLocaleChangedVia via) { |
988 if (new_locale.empty()) { | 980 if (new_locale.empty()) { |
989 NOTREACHED(); | 981 NOTREACHED(); |
990 return; | 982 return; |
991 } | 983 } |
992 PrefService* local_state = g_browser_process->local_state(); | 984 PrefService* local_state = g_browser_process->local_state(); |
993 DCHECK(local_state); | 985 DCHECK(local_state); |
994 if (local_state->IsManagedPreference(prefs::kApplicationLocale)) | 986 if (local_state->IsManagedPreference(prefs::kApplicationLocale)) |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 FilePath* cache_path, | 1153 FilePath* cache_path, |
1162 int* max_size) { | 1154 int* max_size) { |
1163 DCHECK(cache_path); | 1155 DCHECK(cache_path); |
1164 DCHECK(max_size); | 1156 DCHECK(max_size); |
1165 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1157 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
1166 if (!path.empty()) | 1158 if (!path.empty()) |
1167 *cache_path = path; | 1159 *cache_path = path; |
1168 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1160 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1169 prefs_->GetInteger(prefs::kDiskCacheSize); | 1161 prefs_->GetInteger(prefs::kDiskCacheSize); |
1170 } | 1162 } |
| 1163 |
| 1164 base::Callback<ChromeURLDataManagerBackend*(void)> |
| 1165 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
| 1166 return io_data_.GetChromeURLDataManagerBackendGetter(); |
| 1167 } |
OLD | NEW |