| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 #include "chrome/browser/push_messaging/push_messaging_service_factory.h" | 70 #include "chrome/browser/push_messaging/push_messaging_service_factory.h" |
| 71 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" | 71 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" |
| 72 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 72 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 73 #include "chrome/browser/sessions/session_service_factory.h" | 73 #include "chrome/browser/sessions/session_service_factory.h" |
| 74 #include "chrome/browser/signin/signin_manager_factory.h" | 74 #include "chrome/browser/signin/signin_manager_factory.h" |
| 75 #include "chrome/browser/signin/signin_ui_util.h" | 75 #include "chrome/browser/signin/signin_ui_util.h" |
| 76 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" | 76 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" |
| 77 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" | 77 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" |
| 78 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 78 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
| 79 #include "chrome/common/chrome_constants.h" | 79 #include "chrome/common/chrome_constants.h" |
| 80 #include "chrome/common/chrome_paths.h" |
| 80 #include "chrome/common/chrome_paths_internal.h" | 81 #include "chrome/common/chrome_paths_internal.h" |
| 81 #include "chrome/common/chrome_switches.h" | 82 #include "chrome/common/chrome_switches.h" |
| 82 #include "chrome/common/features.h" | 83 #include "chrome/common/features.h" |
| 83 #include "chrome/common/pref_names.h" | 84 #include "chrome/common/pref_names.h" |
| 84 #include "chrome/common/url_constants.h" | 85 #include "chrome/common/url_constants.h" |
| 85 #include "chrome/grit/chromium_strings.h" | 86 #include "chrome/grit/chromium_strings.h" |
| 86 #include "components/bookmarks/browser/bookmark_model.h" | 87 #include "components/bookmarks/browser/bookmark_model.h" |
| 87 #include "components/content_settings/core/browser/cookie_settings.h" | 88 #include "components/content_settings/core/browser/cookie_settings.h" |
| 88 #include "components/content_settings/core/browser/host_content_settings_map.h" | 89 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 89 #include "components/domain_reliability/monitor.h" | 90 #include "components/domain_reliability/monitor.h" |
| (...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1229 // Gets the cache parameters from the command line. If |is_media_context| is | 1230 // Gets the cache parameters from the command line. If |is_media_context| is |
| 1230 // set to true then settings for the media context type is what we need, | 1231 // set to true then settings for the media context type is what we need, |
| 1231 // |cache_path| will be set to the user provided path, or will not be touched if | 1232 // |cache_path| will be set to the user provided path, or will not be touched if |
| 1232 // there is not an argument. |max_size| will be the user provided value or zero | 1233 // there is not an argument. |max_size| will be the user provided value or zero |
| 1233 // by default. | 1234 // by default. |
| 1234 void ProfileImpl::GetCacheParameters(bool is_media_context, | 1235 void ProfileImpl::GetCacheParameters(bool is_media_context, |
| 1235 base::FilePath* cache_path, | 1236 base::FilePath* cache_path, |
| 1236 int* max_size) { | 1237 int* max_size) { |
| 1237 DCHECK(cache_path); | 1238 DCHECK(cache_path); |
| 1238 DCHECK(max_size); | 1239 DCHECK(max_size); |
| 1240 |
| 1239 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1241 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
| 1240 if (!path.empty()) | 1242 if (!path.empty()) |
| 1241 *cache_path = path; | 1243 *cache_path = path.Append(cache_path->BaseName()); |
| 1244 |
| 1242 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1245 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
| 1243 prefs_->GetInteger(prefs::kDiskCacheSize); | 1246 prefs_->GetInteger(prefs::kDiskCacheSize); |
| 1244 } | 1247 } |
| 1245 | 1248 |
| 1246 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { | 1249 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { |
| 1247 #if defined(OS_CHROMEOS) | 1250 #if defined(OS_CHROMEOS) |
| 1248 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 1251 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
| 1249 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 1252 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
| 1250 g_browser_process->local_state()); | 1253 g_browser_process->local_state()); |
| 1251 } | 1254 } |
| 1252 #endif // defined(OS_CHROMEOS) | 1255 #endif // defined(OS_CHROMEOS) |
| 1253 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 1256 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
| 1254 GetPrefs(), g_browser_process->local_state()); | 1257 GetPrefs(), g_browser_process->local_state()); |
| 1255 } | 1258 } |
| 1256 | 1259 |
| 1257 std::unique_ptr<domain_reliability::DomainReliabilityMonitor> | 1260 std::unique_ptr<domain_reliability::DomainReliabilityMonitor> |
| 1258 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1261 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
| 1259 domain_reliability::DomainReliabilityService* service = | 1262 domain_reliability::DomainReliabilityService* service = |
| 1260 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1263 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
| 1261 GetForBrowserContext(this); | 1264 GetForBrowserContext(this); |
| 1262 if (!service) | 1265 if (!service) |
| 1263 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1266 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); |
| 1264 | 1267 |
| 1265 return service->CreateMonitor( | 1268 return service->CreateMonitor( |
| 1266 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1269 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
| 1267 } | 1270 } |
| OLD | NEW |