| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/profile_impl.h" | 5 #include "chrome/browser/profile_impl.h" |
| 6 | 6 |
| 7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 PathService::Get(base::DIR_USER_CACHE, &user_cache_path) && | 298 PathService::Get(base::DIR_USER_CACHE, &user_cache_path) && |
| 299 app_data_path.AppendRelativePath(path_, &user_cache_path)) { | 299 app_data_path.AppendRelativePath(path_, &user_cache_path)) { |
| 300 base_cache_path_ = user_cache_path; | 300 base_cache_path_ = user_cache_path; |
| 301 } | 301 } |
| 302 } | 302 } |
| 303 #elif defined(OS_POSIX) // Posix minus Mac. | 303 #elif defined(OS_POSIX) // Posix minus Mac. |
| 304 // See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html | 304 // See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html |
| 305 // for a spec on where cache files go. The net effect for most systems is we | 305 // for a spec on where cache files go. The net effect for most systems is we |
| 306 // use ~/.cache/chromium/ for Chromium and ~/.cache/google-chrome/ for | 306 // use ~/.cache/chromium/ for Chromium and ~/.cache/google-chrome/ for |
| 307 // official builds. | 307 // official builds. |
| 308 if (!PathService::IsOverridden(chrome::DIR_USER_DATA)) { |
| 308 #if defined(GOOGLE_CHROME_BUILD) | 309 #if defined(GOOGLE_CHROME_BUILD) |
| 309 const char kCacheDir[] = "google-chrome"; | 310 const char kCacheDir[] = "google-chrome"; |
| 310 #else | 311 #else |
| 311 const char kCacheDir[] = "chromium"; | 312 const char kCacheDir[] = "chromium"; |
| 312 #endif | 313 #endif |
| 313 PathService::Get(base::DIR_USER_CACHE, &base_cache_path_); | 314 PathService::Get(base::DIR_USER_CACHE, &base_cache_path_); |
| 314 base_cache_path_ = base_cache_path_.Append(kCacheDir); | 315 base_cache_path_ = base_cache_path_.Append(kCacheDir); |
| 315 if (!file_util::PathExists(base_cache_path_)) | 316 if (!file_util::PathExists(base_cache_path_)) |
| 316 file_util::CreateDirectory(base_cache_path_); | 317 file_util::CreateDirectory(base_cache_path_); |
| 318 } |
| 317 #endif | 319 #endif |
| 318 if (base_cache_path_.empty()) | 320 if (base_cache_path_.empty()) |
| 319 base_cache_path_ = path_; | 321 base_cache_path_ = path_; |
| 320 | 322 |
| 321 // Listen for theme installation. | 323 // Listen for theme installation. |
| 322 registrar_.Add(this, NotificationType::THEME_INSTALLED, | 324 registrar_.Add(this, NotificationType::THEME_INSTALLED, |
| 323 NotificationService::AllSources()); | 325 NotificationService::AllSources()); |
| 324 | 326 |
| 325 // Listen for bookmark model load, to bootstrap the sync service. | 327 // Listen for bookmark model load, to bootstrap the sync service. |
| 326 registrar_.Add(this, NotificationType::BOOKMARK_MODEL_LOADED, | 328 registrar_.Add(this, NotificationType::BOOKMARK_MODEL_LOADED, |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1204 new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess())); | 1206 new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess())); |
| 1205 sync_service_.reset( | 1207 sync_service_.reset( |
| 1206 profile_sync_factory_->CreateProfileSyncService()); | 1208 profile_sync_factory_->CreateProfileSyncService()); |
| 1207 sync_service_->Initialize(); | 1209 sync_service_->Initialize(); |
| 1208 } | 1210 } |
| 1209 | 1211 |
| 1210 void ProfileImpl::InitCloudPrintProxyService() { | 1212 void ProfileImpl::InitCloudPrintProxyService() { |
| 1211 cloud_print_proxy_service_.reset(new CloudPrintProxyService(this)); | 1213 cloud_print_proxy_service_.reset(new CloudPrintProxyService(this)); |
| 1212 cloud_print_proxy_service_->Initialize(); | 1214 cloud_print_proxy_service_->Initialize(); |
| 1213 } | 1215 } |
| OLD | NEW |